I'm learning javascript, and i see sample code for event handling (i.e. onmouseover), where the code is in the <body> section of the html, and there is no script tag and the example appears to work fine.
Can somebody tell me the rules on when you need the script tag and when you don't?
I'm learning javascript, and i see sample code for event handling (i.e. onmouseover), where the code is in the <body> section of the html, and there is no script tag and the example appears to work fine.
Can somebody tell me the rules on when you need the script tag and when you don't?
THanks!,
Jeff S
Show an example of what you are wanting to know about.
Why is it, then, that I went thru my several online html tutorials and Murach's HTML/XHTMS CSS book, and never learned about "onmouseover"? Then, in every online javascript class or my Javascript book, that I'm learning about "onmouseover". Up to now, I thought it was a javascript event handler...Now I'm learning it's really html ...
I think I've got it...or, at least it's ruminating in my brain, and it's starting to make sense...
I've been told thru another forum that although the "onmouseover" is an html attribute, the value is a javascript command. So, it wouldn't be in a beginner's html book, since he wouldn't yet understand javascript.
( I think this stuff may be a little more complicated then the cobol I've been writing for the last 40 years!)
there is good reason you haven't seen onmouseover or onanything. That is what's called obtrusive javascript and violates the principle of separation of content, behavior, and presentation. All javascript should be in a javascript file or embedded in <script> tags, and all styling should be in a css file or embedded in <style> tags. Neither should be an attribute of an element.
Bookmarks