开发者

jquery mouseover

I have a button on my asp.net page and I am using ajax jquery to create a mouseover effect.I want to show alert on mouse over. How can i do开发者_StackOverflow this ?


Try this:

$('#myButtonId').mouseover(function() {
  alert('Hello World!');
});


Include jquery in the head section of your HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js">
</script>

Then in your HTML, you make the button.

<button id="someButton">Mouse over me!</button>

And you attach the mouseover event helper when everything is completed loading.

<script>
// The $ function is used as short-hand for document.ready function.
// http://api.jquery.com/jQuery/
$(function() {
    $("button#someButton").mouseover(function() {
        alert("Hello world");
    });
});
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜