changing selected Option in select using Jquery


  1. jQuery(“select#UserHometown option[selected]”).removeAttr(“selected”); //first remove selected attribute from selected option
  2. jQuery(“select#UserHometown option[value=’192′]”).attr(“selected”, “selected”); // select new option based on its value

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s