Close the Select list after selection using jquery events

Close the Select list after selection using jquery events :- once i have faced such a requirement where i need to close the select list, that’s why i wrote it here for you .

In this post we are going to answer the problem “Close the Select list after selection done using jquery events” :-

Generally we use HTML select list and list is closed automatically so our work is done ,but here we want a functionality in which we have more than oneĀ  HTML Select List

IDCountry
1India
2US
3UK
4Japan
IDcountry_idState
11ABC
22XYZ
33LMP
44OPQ

 

We wants to close the Select list after select using jquery event

HTMLCODE:-

<select class=”form-control features” id=”color2″ >
<option value=”newvalue” >Select Color </option>
<option>Gold </option>
<option> Purple </option>
<option>Black </option>
<option>Grey </option>
</select>
</div>

JS CODE:-

<sctipt>

$(“#color2”).click(function(){

//$(“#def”).text($(this).text());
//$(this).hide();
$(“#color2”).attr(“size”, 0);
});

</script>

Open the select Jquery list

Check all events in jquery

Leave a Reply

Your email address will not be published. Required fields are marked *