+ 1
Click on HTML body with JS
Fairly new to all things web. Can I change a js variable or call a function by having the user click anywhere on the body of the webpage?
1 ответ
+ 3
yes
//js
window.onload = function(){
document.body.addEventListener('click', function(){
alert('you clicked on the body lol')
})
}
//Make sure that something is in the body.