"change" event
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
HTMLElement โฉ change event
<>
"change" event๏ผvalue ่ขซ็ขบ่ชไนๅพ (ๅฆ๏ผๆ enter) ๆๆ่งธ็ผ็ไบไปถใ
"input" event๏ผๅช่ฆ value ็ผ็ๆน่ฎๅฐฑๆ่งธ็ผ็ไบไปถใ
ๅ ไปถ
type
event
<input>
, checkbox
click
<input>
date, file
select
<select>
select
<input>
text
element loses focus after its value was changed, but not committed
<textarea>
(same above)
const list = $('.ice-cream');
list.onchange = (e) => {
const result = $('.result');
result.textContent = `You like ${e.target.value}`;
};
<label>Choose an ice cream flavor:
<select class="ice-cream" name="ice-cream">
<option value="">Select One โฆ</option>
<option value="chocolate">Chocolate</option>
<option value="sardine">Sardine</option>
<option value="vanilla">Vanilla</option>
</select>
</label>
<div class="result"></div>