I would like to create a function in jquery which simulates onMouseOver
event of a specific element on the page. And then call it with a html button like this
onclick="myFunction()"
I would like to create a function in jquery which simulates onMouseOver
event of a specific element on the page. And then call it with a html button like this
onclick="myFunction()"
$("#yourid").on('mouseover', function() {
// do something
});
I did not understand, would it be something like that? I put the mouse over or hover event, to make it easier if you need to.
<div class="wrapper" style="width:200px;height:200px;background:red">
</div>
<button id="myButton">my button</button>
__
$('.wrapper').hover(function(){
console.log('mouse in');
},function(){
$('#myButton').click();
});
$('#myButton').click(function(){
alert('clicked button')
})