9
วิธีรับ $ (this) ตัวเลือกที่เลือกใน jQuery?
รหัสต่อไปนี้ใช้งานได้: $("#select-id").change(function(){ var cur_value = $('#select-id option:selected').text(); . . . }); วิธี refactor บรรทัดที่สองเป็น: var cur_value = $(this).***option-selected***.text(); คุณใช้ทำอะไร***option-selected***?
92
javascript
jquery