Horje
onclick change text color javascript Code Example
onclick change text color javascript
<script>

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

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

</script>
javascript-change color onclick()
const btn = document.querySelector('button');

function random(number) {
  return Math.floor(Math.random() * (number+1));
}

btn.onclick = function() {
  const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')';
  document.body.style.backgroundColor = rndCol;
}




Javascript

Related
react native port Code Example react native port Code Example
search in a table jquery Code Example search in a table jquery Code Example
jquery get value by name Code Example jquery get value by name Code Example
save json file python Code Example save json file python Code Example
javascript read json file Code Example javascript read json file Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10