Now the function looks like this

<script type="text/javascript"> window.onload = function First () { var ds = buftitile; console.log(buftitile);} </script> 

even though it is wrapped in window.onload, the function will still be executed when the page loads.

  • But the onload event is just such a special event that happens when the page loads - Mike
  • But how is the click and page loading related? These are different events. - sepgg

1 answer 1

If you need to perform after each click, then

 document.onlick = function() { var ds = buftitile; console.log(buftitile); }