A shorthand method of putting JavaScript into the HTML document


A shorthand method of putting JavaScript into the HTML document is to use the backquote (‘). Using the backquote, the HTML is automatically generated without having to use the write statement.
The backquote is especially useful when the JavaScript produces an attribute value. Generally, HTML tags have the form of

<TAG ATTRIB=”value” […ATTRIB=VAL]>

where ATTRIB is the attribute and value is its value. Backquoted JavaScript can substitute for any attribute or value in this syntax.