change color by click event javascript
<script>
document.getElementById('change').onclick = changeColor;
function changeColor() {
document.body.style.color = "purple";
return false;
}
</script>var button = document.querySelector("button");
button.addEventListener("click", function() {
const curColour = document.body.style.backgroundColor;
document.body.style.backgroundColor = curColour === 'red' ? 'blue' : 'red';
});
Also in JavaScript:
- discord js channel send
- chartjs start at 0
- angular material checkbox
- on click move item top react
- form in react
- Error: node_modules/@angular/fire/database/interfaces.d.ts:2:10
- jquery get value of element
- angular detect router change
- take off element form end of array
- identify chrome on android using javascript
- how to sho the active navigation ling using javascript
- notify jquery
- javascript remove object element
- javascript rtsp player
- delete an item from array javascript
- convert string to number javascript
- how to make javascript make things disappear
- How to add a new item to an object at a specific position with vanilla JS
- declaring react routes in a separate file and importing
- array to string javascript
- anonymous functions javascript
- go to page jquery
- mongoose node js
- react native search bar