function name() {
const select = document.querySelector("#id");
select.classname = ("customclass")
}
I've written this code. But I'm unable to change the Classname.
function name() {
const select = document.querySelector("#id");
select.classname = ("customclass")
}
I've written this code. But I'm unable to change the Classname.
You need to change the
classNameproperty:Another way would be adding it to the
classListas suggested in the comments: