July 29, 2001 - Computing the Comment's Length | WebReference

July 29, 2001 - Computing the Comment's Length

Yehuda Shiran July 29, 2001
Computing the Comment's Length
Tips: July 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

Internet Explorer 6 can return the length of a comment. The following COMMENT element is embedded in this page without you noticing it of course:

<COMMENT ID="kuku"> This text will not appear in the browser window.</COMMENT>

The following link computes the length of the comment:

<A HREF="//" onclick="javascript:alert(document.all.kuku.length)">Compute Comment's Length</A>;

The length property is supported for comments only by Internet Explorer 6 and above. Click the following link and verify that the length is 49.

This text will not appear in the browser window.Compute Comment's Length;