Skip to content

Commit 1f2d27f

Browse files
AurelioDeRosaarthurvr
authored andcommitted
attr: fix note about changing the type of an input element in IE8 or older
Closes gh-533
1 parent 2e73a31 commit 1f2d27f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

entries/attr.xml

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
<div class="warning">
2121
<p><strong>Note:</strong> Attribute values are strings with the exception of a few attributes such as value and tabindex.</p>
2222
</div>
23-
<div class="warning">
24-
<p><strong>Note:</strong> Attempting to change the <code>type</code> attribute (or property) of an <code>input</code> element created via HTML or already in an HTML document will result in an error being thrown by Internet Explorer 6, 7, or 8.</p>
25-
</div>
2623
<p>As of jQuery 1.6, the <code>.attr()</code> method returns <code>undefined</code> for attributes that have not been set. <strong>To retrieve and change DOM properties such as the <code>checked</code>, <code>selected</code>, or <code>disabled</code> state of form elements, use the <a href="/prop/">.prop()</a> method.</strong></p>
2724

2825
<h4>Attributes vs. Properties</h4>
@@ -197,7 +194,9 @@ $( "#greatphoto" ).attr({
197194
</code></pre>
198195
<p>When setting multiple attributes, the quotes around attribute names are optional.</p>
199196
<p><strong>WARNING</strong>: When setting the 'class' attribute, you must always use quotes!</p>
200-
<p><strong>Note</strong>: jQuery prohibits changing the <code>type</code> attribute on an <code>&lt;input&gt;</code> or <code>&lt;button&gt;</code> element and will throw an error in all browsers. This is because the <code>type</code> attribute cannot be changed in Internet Explorer.</p>
197+
<div class="warning">
198+
<p><strong>Note:</strong> Attempting to change the <code>type</code> attribute on an <code>input</code> or <code>button</code> element created via <code>document.createElement()</code> will throw an exception on Internet Explorer 8 or older.</p>
199+
</div>
201200
<h4 id="computed-attr-values">Computed attribute values</h4>
202201
<p>By using a function to set attributes, you can compute the value based on other properties of the element. For example, to concatenate a new value with an existing value:</p>
203202
<pre><code>

0 commit comments

Comments
 (0)