how to remove class in defult function code example Example: how to remove an class in javascript document.getElementsByClassName("legend").style.display="none";