Holla Tech - Learn

Get Content [/su_quote] 

There are several methods for manipulating the content of  HTML elements via jQuery.
The html() method is used to get the content of the selected element, including the HTML markup.
For example:
HTML: 

<p>
  JQuery is <b>fun</b>
</p> 

 

JS:

$(function() {
  var val = $(“p”).html();
  alert(val);
});
// alerts “JQuery is <b>fun</b>” 

 

Notice, that the HTML markup (the <b> tags) is also returned,
If you need only the text content, without the HTML markup, you can use the text() method:

$(function() {
  var val = $(“p”).text();
  alert(val);
});
// alerts “JQuery is fun” 

 

NOTE!
The html() and text() methods can be used for all HTML elements that can contain content.

Set Content