Name

//, /*...*/ — NN 2 IE J1 ECMA n/a

Synopsis

Comment statements that let you enter nonexecuting text in a script. Any text following the // symbol anywhere in a statement line is ignored by the language interpreter. The next line of script, unless it begins with another // symbol, is interpreted by the browser.

For longer comment blocks, you can begin a block with the /* symbol. Comment blocks may run any number of lines. The block is closed with the */ symbol, after which the interpreter engages subsequent statements.

Example

// convert temp from C to F

/*
many lines
of 
comments
*/

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.