Open A Select Drop Down On Click Of Checkbox Using Jquery
I have a drop down say and a check box,
Solution 1:
EDIT: From mithunsatheesh's answer, I have integrated the doClick
function here:
var doClick = function() {
'use strict';
var event = document.createEvent('MouseEvents');
event.initMouseEvent('mousedown', true, true, window);
return event;
};
$('.hear').click(function() {
'use strict';
$('#countries').focus().get(0).dispatchEvent(doClick());
});
See jsFiddle. Please note that it only works in Chrome (WebKit).
Also, you may wish to bind to the change
event.
Baca Juga
- How Can I Fade Are Background Image In And Out Using Jquery In A Parent Div Without Having It Affect The Child Div?
- Sorting Table Rows According To Table Header Column Using Javascript Or Jquery
- Custom File Input Using Jquery Restrict The User File Types And Filename If The User Click Check Box It Input File Disable
Post a Comment for "Open A Select Drop Down On Click Of Checkbox Using Jquery"