Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #class #html
ADD COMMENT
Topic
Name
3+4 =