Since DOM stripting is inherently attached to the markup it operates on,
either you have read utter nonsense or you have completely misunderstood
what was written. If the former and it was a book, rip it apart, shredder
it, throw it in the trash can, burn it, and sue the author for being
incompetent.
I quote the exact phrase taken by JavaScript Bible Sixth Ed and I
think that
this is a great book and the author Danny is also a professional
javascript programmer!
"""" Separating content from scripting
Those who use CSS to style their sites have learned that separating
style definitions from the HTML markup
makes a huge improvement in productivity when it comes time to change
colors or font specifications
throughout a site. Instead of having to modify hundreds of <font> tag
specifications scattered around the
site, all it takes is a simple tweak of a single CSS rule in one .css
file to have that change be implemented
immediately across the board.
The notion of using HTML purely for a page's structure has also
impacted scripting. It is rare these days for
a professional scripter to put an event handler attribute inside an
HTML tag. That would be considered too
much mixing of content with behavior. In other words, the HTML markup
should be able to stand on its
own so that those with nonscriptable browsers (including those with
vision or motor disabilities who use
specialized browsers) can still get the fundamental information
provided by the page. Any scripting that
impacts the display or behavior of the page is added to the page after
the HTML markup has loaded and
rendered. Even assigning events to elements is done by script after
the page load.
Script code is more commonly linked into a page from an external .js
file. This isn't part of the separation
of content and scripts trend, but a practice that offers many
benefits, such as the same code being instantly
usable on multiple pages. Additionally, when projects involve many
code chefs, scripters can work on their
code while writers work on the HTML and designers work on their
external CSS code """""
However that is only an opinion ... and I'm agree with him (may be you
not)
CSS is a formatting language (not a programming language) which is attached
to its markup with one or more of element relation, `id', `class' or `style'
attribute.
in fact also CSS is attached to HTML (like javascript object code to
tags) and
today web developer doesn't "mix" presentation code (css) with
structural code (html)...
you are contradicting yourself.....
document.body.addEventListener("click", function() { foo(bar); }, false);
thanks this is the answer I was searching.....
Josh