Define HTML tags as the string variable : String Declaration « String « JavaScript Tutorial






<HTML>
<BODY>
<SCRIPT language="JavaScript">
<!--
    var myheading="This is My Web Page!";
    var linktag="<A HREF='http://www.java2s.com'>Web Site Link!</A>";
    var sometext="This text can be affected by other statements.";
    var begineffect="<U>";
    var endeffect="</U>";
    var newsection="<BR>";
    document.write(myheading);
    document.write(newsection);
    document.write(begineffect);
    document.write(sometext);
    document.write(endeffect);
    document.write(newsection);
    document.write(linktag);
    document.write(newsection);
    document.write(sometext);
//-->
</SCRIPT>
</BODY>
</HTML>








6.4.String Declaration
6.4.1.Output string value and length
6.4.2.Define HTML tags as the string variable