- Browsers that do not support JavaScript, will display JavaScript as page content.
- To prevent them from doing this, and as a part of the JavaScript standard, the HTML comment tag should be used to "hide" the JavaScript.
- Just add an HTML comment tag <!-- before the first JavaScript statement, and a --> (end of comment) after the last JavaScript statement.
- However, this is an optional, but considered good practice.
Why do we place JavaScript code inside comment fields?
Subscribe to:
Post Comments
(
Atom
)
0 comments :
Post a Comment