Click here to Skip to main content
15,911,489 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am very much confused between above three properties used in jquery please explain and suggest which one is more effeicernt to use
Posted

1 solution

Check out the this link jQuery.

html()
Obtains the HTML content of the first element in the matched set.
$('#Container').html()

text()---> this is most simple and used
Concatenates all text content of the wrapped elements and returns it as the result of the method. That means this method return all the string which display on our browser.
$('#Container').text()
val()

Returns the value attribute of the first element in the matched set. When the element is a multiselect element, the returned value is an array of all selections. This method only work with control like input, select, button etc. It not work with div, span, p etc.
$('#txtCountry').val()
 
Share this answer
 
v2
Comments
Torakami 10-May-14 10:10am    
Thnks bro ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900