No products in the cart.
Forum Replies Created
Viewing 1 post (of 1 total)
- AuthorPosts
-
January 30, 2014 at 2:29 am in reply to: Get selected text from a drop-down list (select box) using jQuery #9375
nikhil-agrawal
Participant$("#selectID option:selected").text();
Instead of
#selectID
you can use any jQuery selector, like.selectClass
using class.As mentioned in the documentation here.
The :selected selector works for <option> elements. It does not work for checkboxes or radio inputs; use
:checked
for them..text() As per the documentation here.
Get the combined text contents of each element in the set of matched elements, including their descendants.
So you can take text from any HTML element using the
.text()
method.Refer the documentation for a deeper explanation.
- AuthorPosts
Viewing 1 post (of 1 total)