Home > Web Front-end > JS Tutorial > Li Yanhui jquery basic video material sharing

Li Yanhui jquery basic video material sharing

巴扎黑
Release: 2017-08-30 14:20:07
Original
1777 people have browsed it

jQuery is a fast and concise JavaScript framework. It is another excellent JavaScript code library (or JavaScript framework) after Prototype. The purpose of jQuery's design is "write less, do more", which means writing less code and doing more things. It encapsulates common JavaScript function codes, provides a simple JavaScript design pattern, and optimizes HTML document operations, event processing, animation design and Ajax interaction.

Li Yanhui jquery basic video material sharing

Video playback address: http://www.php.cn/course/384.html

The important and difficult points in learning jQuery :

1. Select web page elements

The basic design and main usage of jQuery is to "select a web page element and then perform some operation on it." This is the fundamental feature that distinguishes it from other function libraries.
The first step in using jQuery is often to put a selection expression into the constructor jQuery() (abbreviated as $), and then get the selected element.

The selection expression can be a CSS selector:

$(document)//Select the entire document object
$('#myId')//Select the web page element with the ID myId
$('div.myClass')//Select the div element with class myClass
$('input[name=first]')//Select the input element with name attribute equal to first

It can also be a jQuery-specific expression:

$('a:first')//Select the first a element in the web page
$('tr:odd')//Select the odd number of the table Line
$('#myForm :input')//Select the input element in the form
$('div:visible') //Select the visible div element
$('div:gt(2 )')//Select all div elements, except the first three
$('div:animated')//Select the div element currently in animated state
 
2. Change the result set
If multiple elements are selected, jQuery provides filters that can narrow the result set:

* $('div').has('p'); //Select the div element containing the p element
* $('div').not('.myClass'); //Select div elements whose class is not equal to myClass
* $('div').filter('.myClass'); //Select class equal to myClass The div element
* $('div').first(); //Select the 1st div element
* $('div').eq(5); //Select the 6th div element
Sometimes, we need to start from the result set and move to nearby related elements. jQuery also provides a method of moving on the DOM tree:

$('div').next('p' ); //Select the first p element after the div element
$('div').parent(); //Select the parent element of the div element
$('div').closest('form '); //Select the form parent element closest to the div
$('div').children(); //Select all the child elements of the div
$('div').siblings(); //Select sibling elements of div

The above is the detailed content of Li Yanhui jquery basic video material sharing. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template