In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "jquery how to modify the value of the specified attribute", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "jquery how to modify the value of the specified attribute" bar!
In jquery, you can use the attr () method to modify the value of a specified attribute, which sets the property value of the selected element, with the syntax "$(selector) .attr (" attribute name "," attribute value ")" or "$(selector). Attr ({attribute name: attribute value})".
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
In jquery, you can use the attr () method to modify the value of a specified property.
The attr () method sets or returns the property value of the selected element. The working mode of the method is also different according to the different parameters of the method.
The syntax for setting the property value:
$(selector) .attr (attribute,value) / / single attribute / value pair $(selector) .attr ({attribute:value, attribute:value...}) / / multiple attribute / value pairs
Example:
$(document) .ready (function () {$("button") .click (function () {$("img"). Attr ("width", "380");})
Set the width property of the image
$(document) .ready (function () {$("button") .click (function () {$("img"). Attr ({width: "300", height: "350"});})
Set the width and height properties of the image
Thank you for your reading, the above is the content of "jquery how to modify the value of the specified attribute", after the study of this article, I believe you have a deeper understanding of how jquery modifies the value of the specified attribute, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.