Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
6850c4b2
Commit
6850c4b2
authored
Feb 27, 2007
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backported wiki changes from
http://docs.jquery.com/API/1.1.1/DOM/Attributes
parent
68d8e53d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
jquery.js
src/jquery/jquery.js
+15
-10
No files found.
src/jquery/jquery.js
View file @
6850c4b2
...
@@ -356,6 +356,9 @@ jQuery.fn = jQuery.prototype = {
...
@@ -356,6 +356,9 @@ jQuery.fn = jQuery.prototype = {
* This method makes it easy to retrieve a property value
* This method makes it easy to retrieve a property value
* from the first matched element.
* from the first matched element.
*
*
* If the element does not have an attribute with such a
* name, undefined is returned.
*
* @example $("img").attr("src");
* @example $("img").attr("src");
* @before <img src="test.jpg"/>
* @before <img src="test.jpg"/>
* @result test.jpg
* @result test.jpg
...
@@ -387,8 +390,6 @@ jQuery.fn = jQuery.prototype = {
...
@@ -387,8 +390,6 @@ jQuery.fn = jQuery.prototype = {
/**
/**
* Set a single property to a value, on all matched elements.
* Set a single property to a value, on all matched elements.
*
*
* Can compute values provided as ${formula}, see second example.
*
* Note that you can't set the name property of input elements in IE.
* Note that you can't set the name property of input elements in IE.
* Use $(html) or .append(html) or .html(html) to create elements
* Use $(html) or .append(html) or .html(html) to create elements
* on the fly including the name property.
* on the fly including the name property.
...
@@ -398,11 +399,6 @@ jQuery.fn = jQuery.prototype = {
...
@@ -398,11 +399,6 @@ jQuery.fn = jQuery.prototype = {
* @result <img src="test.jpg"/>
* @result <img src="test.jpg"/>
* @desc Sets src attribute to all images.
* @desc Sets src attribute to all images.
*
*
* @example $("img").attr("title", "${this.src}");
* @before <img src="test.jpg" />
* @result <img src="test.jpg" title="test.jpg" />
* @desc Sets title attribute from src attribute, a shortcut for attr(String,Function)
*
* @name attr
* @name attr
* @type jQuery
* @type jQuery
* @param String key The name of the property to set.
* @param String key The name of the property to set.
...
@@ -413,7 +409,9 @@ jQuery.fn = jQuery.prototype = {
...
@@ -413,7 +409,9 @@ jQuery.fn = jQuery.prototype = {
/**
/**
* Set a single property to a computed value, on all matched elements.
* Set a single property to a computed value, on all matched elements.
*
*
* Instead of a value, a function is provided, that computes the value.
* Instead of supplying a string value as described
* [[DOM/Attributes#attr.28_key.2C_value_.29|above]],
* a function is provided that computes the value.
*
*
* @example $("img").attr("title", function() { return this.src });
* @example $("img").attr("title", function() { return this.src });
* @before <img src="test.jpg" />
* @before <img src="test.jpg" />
...
@@ -1032,7 +1030,14 @@ jQuery.fn = jQuery.prototype = {
...
@@ -1032,7 +1030,14 @@ jQuery.fn = jQuery.prototype = {
},
},
/**
/**
* Get the current value of the first matched element.
* Get the content of the value attribute of the first matched element.
*
* Use caution when relying on this function to check the value of
* multiple-select elements and checkboxes in a form. While it will
* still work as intended, it may not accurately represent the value
* the server will receive because these elements may send an array
* of values. For more robust handling of field values, see the
* [http://www.malsup.com/jquery/form/#fields fieldValue function of the Form Plugin].
*
*
* @example $("input").val();
* @example $("input").val();
* @before <input type="text" value="some text"/>
* @before <input type="text" value="some text"/>
...
@@ -1044,7 +1049,7 @@ jQuery.fn = jQuery.prototype = {
...
@@ -1044,7 +1049,7 @@ jQuery.fn = jQuery.prototype = {
*/
*/
/**
/**
*
Set the valu
e of every matched element.
*
Set the value attribut
e of every matched element.
*
*
* @example $("input").val("test");
* @example $("input").val("test");
* @before <input type="text" value="some text"/>
* @before <input type="text" value="some text"/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment