JQuery gets the sample code for the content and properties

  • 2020-03-30 01:24:40
  • OfStack

Get content-text (), HTML (), and val()

Three simple and useful jQuery methods for DOM manipulation:

Text () - sets or returns the text content of the selected element
HTML () - sets or returns the content of the selected element (including HTML markup)
Val () - sets or returns the value of the form field

Get attribute -attr ()

The jQuery attr() method is used to get the attribute value.

The following example shows how to get the value of the href attribute in the link:
The instance

Related articles: