. "" , . , "hovered" true, , false.
, , onchange. , onchange, , .
Of course, this is a quick and dirty solution to give you an idea. It can be done better. Hope this helps :)
var hovered = false;
$('#button').mouseover(function(){
hovered = true;
}).mouseleave(function(){
hovered = false;
});
$(function(){
$('#button').bind("click",function(){
alert("button click");
});
$('#textbox').bind("change",function(){
alert("text changed");
if (hovered)
$('#button').trigger('click');
});
});β
source
share