JQuery - Get the selected item's text in a dropdown
By [)ia6l0 iii
Use the ":selected" modifier on the option element.
$("#dropDownName option:selected").text()
Related FAQs
Use the Load method to load the html from a url into an element using jQuery. You will have to ensure that the url belongs to the same domain.
Use the following script.
We can use the appspot IPAddress provider server , that returns the ip of the requesting client in the Json format. Use the callback function and retrieve the IP Address.
If you hit the following url, you will find the json response.
http://jsonip.appspot.com/
{"ip": "111.22.333.444", "address":"111.22.333.444"}
Use the each method to loop thru the element collection. The following example loops through the img elements.
You can use the RemoveClass method to remove the style on an element.
Use the length property of an element to determine if it exists
JQuery - Get the selected item's text in a dropdown (577 Views)