How to select elements ending with something in jquery

coldplay.xixi
Release: 2023-01-04 09:38:02
Original
3097 people have browsed it

How jquery selects the ending element: You can use the [[attribute$=value]] selector to select the element ending at the specified end. The selector selects each element with the specified attribute and ending with the specified string. Element, the syntax is [$("[attribute$=string]")].

How to select elements ending with something in jquery

The operating environment of this tutorial: windows7 system, jquery1.10.2 version, DELL G3 computer.

Recommended:jquery video tutorial

##How to choose the ending element in jquery:

In jquery, you can use the

[attribute$=value]selector to select elements at the specified end.

[attribute$=value]The selector selects each element with the specified attribute and ending with the specified string.

Syntax

$("[attribute$=string]")
Copy after login

Parameters:

  • attribute: required. Specifies the properties to look for.

  • string: required. A string specifying the end of the attribute value.

Example: Select all elements with id attributes and attribute values ending with "header"

      

Welcome to My Homepage

My name is Donald

I live in Duckburg

My best friend is Mickey

My uncle is Scrooge

Who is your favourite:
  • Goofy
  • Mickey
  • Pluto
Copy after login

Rendering:

How to select elements ending with something in jquery

Related free learning recommendations:javascript(Video)

The above is the detailed content of How to select elements ending with something in jquery. 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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!