Usage analysis of jQuery lookup based on name attribute

  • 2021-06-29 10:00:38
  • OfStack

This article provides an example of how jQuery can look up an name attribute.Share it for your reference, as follows:


$("div[id]") // Select All Contains id Attributed div element 
$("input[name='newsletter']") // Select All name Attribute equals 'newsletter' Of input element 
$("input[name!='newsletter']") // Select All name Attribute is not equal to 'newsletter' Of input element 
$("input[name^='news']") // Select All name Attribute to 'news' initial input element 
$("input[name$='news']") // Select All name Attribute to 'news' Ending input element 
$("input[name*='man']") // Select All name Attribute Containment 'news' Of input element 
$("input[id][name$='man']") // You can use multiple attributes to make a joint selection, and this selector gets all of the containing id Attributes and then attributes to man The element at the end 

For example: $(": input [name='login']") means you are looking for a form where name is login

More readers interested in jQuery-related content can view this site's topics: jQuery Operation DOM Node Method Summary, jQuery Extended Skills Summary, jQuery Common Plug-ins and Usages Summary, jQuery Dragging Special Effects and Skills Summary, jQuery Table (table) Operation Skills Summary, Ajax Usage Summary in jquery, andSummary of jQuery's Common Classic Special Effects, Summary of jQuery Animation and Usage, and Summary of jquery Selector Usage

I hope that the description in this paper will be helpful to everyone's jQuery program design.


Related articles: