JavaScript Reference/Javascript Properties/canHaveHTML
Версия от 18:30, 25 мая 2010; (обсуждение)
"canHaveHTML" Example
<html>
<body id="myBody">
<button onclick="alert(myBody.canHaveHTML);">
Can BODY Have HTML
</button>
<input type="text"
id="myText"
value="This cannot have children!">
<button onclick="alert(myText.canHaveHTML);">
Can INPUT Have HTML
</button>
</body>
</html>
"canHaveHTML" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<a> <acronym> |
| |<address> <applet> |
| |<area> <b> |
| |<base> <basefont> |
| |<bdo> <bgsound> |
| |<big> <blockquote> |
| |<body> <br> |
| |<button> <caption> |
| |<center> <cite> |
| |<code> <col> |
| |<colgroup> <comment> |
| |<custom> <dd> |
| |defaults <del> |
| |<dfn> <dir> |
| |<div> <dl> |
| |<dt> <em> |
| |<embed> <fieldset> |
| |<font> <form> |
| |<frame> <frameset> |
| |<head> <hn> |
| |<hr> <html> |
| |<i> <iframe> |
| |<img> <input type="button"> |
| |<input type="checkbox"> <input type="file"> |
| |<input type="hidden"> <input type="image"> |
| |<input type="password"> <input type="radio"> |
| |<input type="reset"> <input type="submit"> |
| |<input type="text"> <ins> |
| |<isindex> <kbd> |
| |<label> <legend> |
| |<li> <link> |
| |<listing> <map> |
| |<marquee> <menu> |
| |<nobr> <noframes> |
| |<noscript> <object> |
| |<ol> <option> |
| |<p> <plaintext> |
| |<pre> <q> |
| |<rt> <ruby> |
| |<s> <samp> |
| |<script> <select> |
| |<small> <span> |
| |<strike> <strong> |
| |styleSheet <sub> |
| |<sup> <table> |
| |<tbody> <td> |
| |<textarea> <tfoot> |
| |<th> <thead> |
| |<title> <tr> |
| |<tt> <u> |
| |<ul> <var> |
| |<wbr> <xml> |
| |<xmp> |
+----------------+--------------------------------------------------------------+
"canHaveHTML" Syntax and Note
Note:
Read-only property.
Indicates whether or not the element can contain HTML content.
Most elements allow HTML content between their opening and closing tags,
but some elements like <br> do not.
Syntax:
document.all.elementID.canHaveHTML