jQuery summary

jQuery is a lightweight JavaScript library that greatly simplifies JavaScript programming

(basic syntax):
$(selector) .action() ①Dollar
sign defines jQuery ②Selector
queries and finds HTML elements
③action() executes Element operation

② contains element selector, attribute selector, css selector
(document ready function):
To prevent the document from running jQuery code before it is fully loaded, all jQuery functions are located in a document ready function:
$(document).ready( function(){ 
  });

jQuery event methods (click, double click, mouse hover)
event methods trigger events on matched elements, or bind a function to an event on all matched elements.
Trigger example:
$("button#demo").click()
The above example will trigger the click event of the button element with id="demo".
Binding example:
$("button#demo").click(function(){$("img").hide()})

(effect:) slide, fade, animation (by default, all HTML elements' Positions are static and cannot be moved. To manipulate the position, remember to first set the CSS position property of the element to relative, fixed or absolute)

jQuery effect function----->Example: hide() hides the selected element
jQuery document operation method------>Example: html() Sets or returns the HTML content in the set of matched elements
jQuery property operation method ------>Get or set element's DOM property
jQuery CSS manipulation function------>Set or return element's CSS related property
jQuery Ajax manipulation function------>jQuery library has complete Ajax Compatible kit. The functions and methods in it allow us to load data from the server without refreshing the browser.
jQuery traversal functions ------> methods for filtering, finding and concatenating elements
jQuery data manipulation functions ------> associates specified DOM elements with arbitrary data

(add jQuery library to the page)
The jQuery library is located at A JavaScript file that contains all jQuery functions. jQuery
can be added to a web page with the following tags:
<head>
<script type="text/javascript" src="jquery.js"></script>
</ head>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326944999&siteId=291194637