Skip to content

Instantly share code, notes, and snippets.

@mariapaulinar
Created March 3, 2017 13:26
Show Gist options
  • Save mariapaulinar/88434178bfa58b56107437c595b53bde to your computer and use it in GitHub Desktop.
Save mariapaulinar/88434178bfa58b56107437c595b53bde to your computer and use it in GitHub Desktop.
//Seleccionar un option específico en un select
$('option[value="SEL1"]').prop('selected', true); //Por value
$('option:eq(1)').prop('selected', true); //Por índice
$('option:contains("Selección 1")').prop('selected', true); //Por algún texto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment