How to Annotate in HTML

Author: Peter Berry
Date Of Creation: 16 February 2021
Update Date: 16 May 2024
Anonim
How to annotate web pages using JavaScript
Video: How to annotate web pages using JavaScript

Content

Commenting on the code will allow you to leave reminders and explanations for yourself and other developers working on the site. Notes can also be used to disable scripts when you are testing or working on a new feature that is not yet complete. Learning how to properly annotate will make programming more efficient for you and your colleagues.

Steps

  1. Insert a comment line. Comments are indicated by tags and ->. You can quickly insert a comment to remind yourself of the code's problem.
    • Make sure there are no spaces between the caption tags. For example, card < !- Note cannot be activated. Inside the caption tag, you can add as many spaces as you want.

  2. Create multiple comment lines. Your notes can span multiple lines, which is great for explaining complex codes or disabling large scripts.
  3. Use annotation to quickly disable a snippet. If you are debugging or want to prevent code from continuing to run on a web page, you can use the annotation feature to quickly block the code. As such, you just need to delete the caption tag and you can easily restore the code.

  4. Use annotation to hide scripts on non-Java browsers. If you are programming on JavaScript or VBScript, you can use the annotation feature to hide scripts on browsers that do not support it. At the beginning of the script, insert a caption and end with tags //-> to ensure that the script works only on browsers have support.
    • Sign // at the end of the tag will prevent the script from executing the annotation feature if it is supported by the browser.
    advertisement

Advice

  • Comments are a good programming practice because this helps you remember how things work and will make it easier for you to come back to working with the code.