Answers for "how to change color of a element when i clicked on it in html"

CSS
3

onclick change text color javascript

<script>

    document.getElementById('change').onclick = changeColor;   

    function changeColor() {
        document.body.style.color = "purple";
        return false;
    }   

</script>
Posted by: Guest on May-14-2020
14

css onclick change color

<style>
.dabutton:focus {
    background-color:yellow;
}
</style>
<button class="dabutton"></button> // <-- usage
Posted by: Guest on July-03-2020

Code answers related to "how to change color of a element when i clicked on it in html"

Browse Popular Code Answers by Language