This is a simple script to select first option of a select-box using jquery
$('button').click(function(){
$("#CardCountry").val($("#CardCountry option:first").val());
});
Dropdown Reset Javascript
Posts tagged with this label
Showing posts with label Dropdown Reset Javascript. Show all posts
How To Get Height Of An Element In jQuery
•
Tapovan
There is are three methods in JQuery that deals with the height of a element.
.height() : it measure the height of the element/container excluding applied padding, margin and border-width.
.innerHeight() : it measure the height of the element/container excluding applied margin…
Dropdown Reset Javascript
•
Tapovan
To reset dropdown/ or selectbox, we can simply fire this javascript code on any dom event
document.getElementById("id_of_selectbox").selectedIndex = -1;
The selectedIndex method of javascript will reset the index of the selected dropbox.
Another and better optio…
an "open and free" initiative. Powered by Blogger.