Skip to content

Instantly share code, notes, and snippets.

@mcunha98
Created January 17, 2020 14:06
Show Gist options
  • Select an option

  • Save mcunha98/74d98c83993fa851853c51d9fb29291c to your computer and use it in GitHub Desktop.

Select an option

Save mcunha98/74d98c83993fa851853c51d9fb29291c to your computer and use it in GitHub Desktop.
<select id="anexos">
<option data-id="1">one</option>
<option data-id="2">two</option>
<option data-id="3">three</option>
</select>
$('#anexos').click(function(){
$(this).find(':selected').data('id')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment