Here i am trying to call class and get the value in variable to remove its attribute style and setting style again but it shows error like this
Uncaught TypeError: cls.removeAttribute is not a function.
cls = document.getElementsByClassName("ps-scrollbar-x-rail");
cls1 = document.getElementsByClassName("ps-scrollbar-x");
cls2 = document.getElementsByClassName("ps-scrollbar-y-rail");
//alert(cls);
//alert(cls1);
//alert(cls2);
//console.log(cls);
//console.log(cls1);
//console.log(cls2);
cls.removeAttribute("style");
cls1.removeAttribute("style");
cls2.removeAttribute("style");
cls.setAttribute("style","width: 600px; left: 258px; bottom: 1px;");
cls1.setAttribute("style","left: 143px; width: 333px;");
cls2.setAttribute("style","top: 0px; right: -255px;");
Onclick to call this method. Which shows error.