Home > Web Front-end > JS Tutorial > body text

A small example of jquery searching based on the name attribute_jquery

WBOY
Release: 2016-05-16 17:13:14
Original
999 people have browsed it
Copy code The code is as follows:

$("div[id]")                                                                                                                                                                                   div element
$("input[name='newsletter']") Select all input elements whose name attribute is equal to 'newsletter'

$("input[name!='newsletter']") Select all input elements whose name attribute is not equal to 'newsletter'

$("input[name^='news']") Select all input elements whose name attribute starts with 'news'
$ ("input[name$='news']") Select all input elements whose name attribute ends with 'news'
$("input[name*='man']") Select all input elements whose name attribute contains ' The input element of news'

$("input[id][name$='man']") can use multiple attributes for joint selection. This selector gets all the attributes containing the id and then attributes Elements ending with man
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