I know how to put javascript in an element directly, like:
<div onclick="this.style.opacity='0'">Some Text</div>
Or
<div onmouseover="this.style.opacity='0'">Some Text</div>
etc.
But Instead of using javascript in the element tag how can we provide the same action by putting the js code in <script> tag.
Using jquery, you could do
Of course you could also do it without jquery, but don’t forget that the code should be called after the dom is ready (document onload event)