The script tag takes two important attributes −
This function can be used to write text, HTML, or both. Take a look at the following code. Live Demo
This code will produce the following result −
Whitespace and Line Breaks
Semicolons are Optional
But when formatted in a single line as follows, you must use semicolons −
Note − It is a good programming practice to use semicolons.
- Any text between the characters /* and */ is treated as a comment. This may span multiple lines.
470 total views, 1 views today