Get content - text(), html() and val()
Three simple and practical jQuery methods for DOM manipulation:
text() - Set or return the selected element's Text content
html() - Sets or returns the content of the selected element (including HTML tags)
val() - Sets or returns the value of a form field
Get attributes - attr()
jQuery attr() method is used to get the attribute value.
The following example demonstrates how to get the value of the href attribute in the link:
Example