devxlogo

The ‘greater-than’ vs. ‘comment’ dilemna

The ‘greater-than’ vs. ‘comment’ dilemna

Question:
The ‘greater-than’ vs. ‘comment’ dilemna

Answer:
There is a trick in writing JavaScripts which all developers should learn as soon as possible. When putting a script in your HTML, you should comment out the code (using ). The comments will keep the code from actually being written on the web page, yet won’t stop the parser from loading the script. Here’s a peek at what this looks like:

1. <hmtl>2. <title>A comment test</title>3. <SCRIPT LANGUAGE="JavaScript">4. <!-- This will hide the script from being displayed5. . . .6. // -->7. </SCRIPT>8. 9. . . . </hmtl>
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist