jQuery Event Methods
// There are quite a few abstracted versions of the following
$('element').on('event', function() {
// Do something
});
// Where 'event' is something such as 'click', 'hover' etc
// They are abstracted as seen below
$('element').click(function(){
// Do something
});
$('element').hover(function(){
// Do something
});
// etc...<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p>If you click on me, I will disappear.</p>
<p>Click me away!</p>
<p>Click me too!</p>
</body>
</html>
Also in JavaScript:
- slide when mouse over gadget jquery
- observable js
- Module not found: Error: Can't resolve 'core-js/client/shim'
- javascript get a random number with 6 digits
- node stdin read char by char
- javascript keywords
- mv multiple directories
- how to create show more item in javascript
- Vuejs v-model when enter pressed
- text editor
- moment js difference between two dates
- after click text editior open in javascript
- decimal to base 32 javascript
- html to pdf javascript
- Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
- The missing value javascript
- how to make a javascript for loop
- nestjs cors origin
- locak storage for table\ js
- is a letter javascript
- create json string c#
- vue js implementation
- change the color of text in javascript
- js repeat