Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method for jquery to get name

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "what is the method for jquery to obtain name", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "what is the way for jquery to obtain name".

$("div [id]") / / Select all div elements that contain the id attribute

$("input [name = 'keleyicom']") / / Select all name elements whose input attribute is equal to' keleyicom'

$("input [nameplates created keleyom']") / / Select all input elements whose name attributes are not equal to 'keleyicom''

$("input [name ^ = 'keleyi']") / / Select all name elements whose input attributes start with' keleyi'

$("input [name $= 'keleyi']") / / Select all name elements whose input attributes end with' keleyi'

$("input [name * = 'keleyi']") / / Select all name attributes that contain the input element of' keleyi'

$("input [id] [name$='keleyi']") / / multiple attributes can be used for joint selection. The selector gets all the elements that contain the id attribute and then the attribute ends in keleyi.

According to the name value:

("input [name = 'mobile']") .val ()

Traverses according to the value of name:

("input [name = 'mobile']") .each (

Function () {

Alert ($(this) .val ()

}

)

Remove the input from the form:

$(document) .ready (function () {

Vara=$ ("forminput")

$.each (

A

Function (name,object) {

Alert (name+ ":" + $(object) .val ())

}

)

})

/ / get the value (in the case of multiple values):

$("input [name = 'mobile']") [0] .value

$("input [name = 'mobile']") .get (1) .value

-jquery add and delete styles-

/ / add styles to a label:

$("# id") .addClass ("style")

/ / Delete the style of a label:

$("# id") .removeClass ("style")

/ / Note: "# id" id is the id,style of the corresponding tag and the name of the corresponding css style

/ / get the value obtained by selecting the radio label

$("input [name = 'xxxx']: checked") .val ()

The above is all the content of the article "what is the way for jquery to get name?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report