13 Ocak 2023 Cuma

Get selected get customer attribute drop-down with JavaScript

 

<select id="location">
    <option value="a" myTag="123">My option</option>
    <option value="b" myTag="456">My other option</option>
</select>

alert($('#location').find('option:selected').attr('myTag'));


Hiç yorum yok: