Answers for "add class name in html"

0

add class name in html

<script type="text/javascript">
    function changeClass(){
        // Code examples from above
    }

    window.onload = function(){
        document.getElementById("MyElement").addEventListener( 'click', changeClass);
    }
</script>
...
<button id="MyElement">My Button</button>
Posted by: Guest on September-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language