Use the js effect multiple times in the same page?

dd();

function dd() {
    var s = document.getElementsByClassName("pingStar")[0],
        m = document.getElementsByClassName("dir")[0],
        n = s.getElementsByTagName("li"),
        input = document.getElementsByClassName("startP")[0]; //
    clearAll = function () {
        for (var i = 0; i < n.length; iPP) {
            n[i].className = "";
        }
    }
    for (var i = 0; i < n.length; iPP) {
        n[i].onclick = function () {
            var q = this.getAttribute("rel");
            clearAll();
            input.value = q;
            for (var i = 0; i < q; iPP) {
                n[i].className = "on";
            }
            m.innerHTML = this.getAttribute("title");
        }
        n[i].onmouseover = function () {
            var q = this.getAttribute("rel");
            clearAll();
            for (var i = 0; i < q; iPP) {
                n[i].className = "on";
            }
        }
        n[i].onmouseout = function () {
            clearAll();
            for (var i = 0; i < input.value; iPP) {
                n[i].className = "on";
            }
        }
    }
}

how can you use this code to achieve several such effects at the same time

in the same page?
Mar.11,2021

send in s, m, input with parameters?

function dd(s, m, input) {
  var n = s.getElementByTagName('li');
  // 
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eada10-216c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eada10-216c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?