Tip of the day

06 Sep

Hi folks,

Yesterday i have faced one simple but time consuming issue, let me share with you all.

Add a value to the 0th position and make selected to the existing dropdown using JQuery.


On Change of the dropdown1 value should fetch all the values and populate in the dropdown2. If we select another value in the dropdown1, dropdown2 values should be empty and should select default value select for the existing dropdown until the response return.


$(“#elementId”).empty(); // Step1 : empty the dropdown

$(“#elementId”).prepend(“<option value=” selected=’selected’>Select</option>”); // Steps 2 : made default value select

Happy Learning!.

Get glued to know more updates.

Have a nice day

Leave a comment

Posted by on September 6, 2013 in Uncategorized


Leave a Reply

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

You are commenting using your 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

%d bloggers like this: