jQuery Events
Events in jQuery

When User do some action is call event.

like click on button, mouse moving, keypress etc.

Mouse Events
click
dblclick
mouseenter
mouseleave

Keyboard Events
Keypress
keydown
keyup

Form Events
Submit
change
focus
blur

Document/Window Events
Load
resize
scroll
unload

Example - To hide current HTML Element(By Online Google CDN path)

<html>
<head>
<script src="jquery-3.2.1.min.js"/></script>
<script>
$(document).ready(function()
{
$("h2").click(function(){
$(this).hide();
});
}
);
</script>
</head>
<body>
<h2>this is h2</h2>
</body>
</html>

Example2 by Using Google CDN

<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"/></script>
<script>
$(document).ready(function()
{
$("h2").click(function(){
$(this).hide();
});
}
);
</script>
</head>
<body>
<h2>this is h2</h2>
</body>
</html>


Previous
Next