The event handler can be bound to the text input and the select box:<form><input class="target" type="text" value="Field 1"><select class="target"><option value="option1" selected="selected">Option 1</option><option value="option2">Option 2</option></select></form><div id="other">Trigger the handler</div>
1
2
3
|
|
.change() without arguments:
1
2
3
|
|
change event on both of the form elements.As of jQuery 1.4, the
change event bubbles in Internet Explorer, behaving consistently with the event in other modern browsers.Examples:
Example: 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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
|
댓글
댓글 쓰기