Skip to content

val: Remove use of nonstandard selectors#994

Closed
gibson042 wants to merge 3 commits into
jquery:masterfrom
gibson042:993
Closed

val: Remove use of nonstandard selectors#994
gibson042 wants to merge 3 commits into
jquery:masterfrom
gibson042:993

Conversation

@gibson042
Copy link
Copy Markdown
Member

Fixes gh-993

Comment thread entries/val.xml Outdated
<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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to get at values" -> "to get their values"?

Comment thread entries/val.xml Outdated
});
</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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"inputs' values." ->"inputs' values. Only inputs having tags as a class name are selected."

@gibson042
Copy link
Copy Markdown
Member Author

@AurelioDeRosa updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants