Find a value of dropdown by text and set it as selected value in jquery

Solution

var myText = "Pakistan";
$("#CountryDropDownList option:contains(" + myText + ")").attr('selected', 'selected');

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started