canHaveHTML
Property of dom/HTMLElementdom/HTMLElement
Syntax
var result = element.canHaveHTML;
element.canHaveHTML = value;
Examples
The following example shows how to use the canHaveHTML property to determine whether an object can contain HTML markup.
<HTML>
<HEAD>
<SCRIPT>
function answer(arg) {
arg ? alert("Yes") : alert("No");
}
</SCRIPT>
</HEAD>
<BODY>
<P>INPUT: <INPUT type="text" ID="oInput" VALUE="oInput" /></P>
<P>SPAN: <SPAN ID="oSpan">oSpan</SPAN></P>
<BUTTON onclick="answer(oInput.canHaveHTML);">
Can the INPUT contain HTML?
</BUTTON>
<BUTTON onclick="answer(oSpan.canHaveHTML);">
Can the SPAN contain HTML?
</BUTTON>
</BODY>
</HTML>
Notes
Remarks
The property is read-only for all objects except the following, for which it is read-write: defaults.
Syntax
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]