Right now I'm using <body onload="function">, which changes some text on the page based on which element is focused on. It works fine, but I need my site to run the function every time the focus changes (or, even better, every time any part of the page is clicked).
Currently the code looks like this:
<body onload="changeText()">
<script>
function changeText(){
function here;
}
</script>
<p>This is where text changes based on the function</p>
Thanks!
onclickto.Searching SO I couldn't find a similar question. And that is what matters.oh really? stackoverflow.com/questions/3521487/javascript-body-onclick , stackoverflow.com/questions/9152802/… , stackoverflow.com/questions/12762472/…onclickevent where as sway doesn't. The 2nd SO link is the best but if you have no idea what onclick is to begin with this question's title is better for the beginner. I wouldn't consider the 1st link related, especially to a beginner. The 3rd is close but still for a beginner is not obvious especially with textarea in the title.