Skip to content

Commit 7028bd0

Browse files
committed
change: note that JS-initiated change does not trigger change event
1 parent 0c7e90b commit 7028bd0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

entries/change.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ $( "#other" ).click(function() {
5252
</code></pre>
5353
<p>After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message. The message will display twice, because the handler has been bound to the <code>change</code> event on both of the form elements.</p>
5454
<p>As of jQuery 1.4, the <code>change</code> event bubbles in Internet Explorer, behaving consistently with the event in other modern browsers.</p>
55+
<div class="warning">
56+
<p><strong>Note: </strong> changing the value of an input element using JavaScript, using <a href="/val"><code>.val()</code></a> for example, won't fire the event.</p>
57+
</div>
5558
</longdesc>
5659
<example>
5760
<desc>Attaches a change event to the select that gets the text for each selected option and writes them in the div. It then triggers the event for the initial text draw.</desc>

entries/val.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ $( "input:text.items" ).val(function( index, value ) {
130130
});
131131
</code></pre>
132132
<p>This example appends the string " items" to the text inputs' values.</p>
133+
<div class="warning">
134+
<p><strong>Note: </strong> changing the value of an input element using this method won't fire the <code><a href="/change">change</a></code> event.</p>
135+
</div>
133136
</longdesc>
134137
<example>
135138
<desc>Set the value of an input box.</desc>

0 commit comments

Comments
 (0)