val: Remove use of nonstandard selectors#994
Closed
gibson042 wants to merge 3 commits into
Closed
Conversation
AurelioDeRosa
requested changes
Dec 19, 2016
| <p>The <code>.val()</code> method is primarily used to get the values of form elements such as <code>input</code>, <code>select</code> and <code>textarea</code>. When called on an empty collection, it returns <code>undefined</code>.</p> | ||
| <p>When the first element in the collection is a <code>select-multiple</code> (i.e., a <code>select</code> element with the <code>multiple</code> attribute set), <code>.val()</code> returns an array containing the value of each selected option. <strong>As of jQuery 3.0</strong>, if no options are selected, it returns an empty array; <strong>prior to jQuery 3.0</strong>, it returns <code>null</code>.</p> | ||
| <p>For selects, checkboxes and radio buttons, you can also use the <a href="/selected-selector/">:selected</a> and <a href="/checked-selector/">:checked</a> selectors to get at values. For example:</p> | ||
| <p>For selects, checkboxes and radio buttons, you can also use the <a href="/checked-selector/">:checked</a> selector to get at values. For example:</p> |
Member
There was a problem hiding this comment.
"to get at values" -> "to get their values"?
| }); | ||
| </code></pre> | ||
| <p>This example appends the string " items" to the text inputs' values.</p> | ||
| <p>This example removes leading and trailing whitespace from the text inputs' values.</p> |
Member
There was a problem hiding this comment.
"inputs' values." ->"inputs' values. Only inputs having tags as a class name are selected."
Member
Author
|
@AurelioDeRosa updated. |
AurelioDeRosa
approved these changes
Dec 19, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes gh-993