javascript - How to get html tag's inner html in js/jquery? -
for example have:
<p class="question"> paragraph <p> , i'm inside tag in question class <h1> , heading</h1> </p> </p>
the question how can inner html of question class below:
this paragraph <p> , i'm inside tag in question class <h1> , heading</h1> </p>
there 2 functions inner html of element
.text()
.html()
.text()
console.log($(".question").text());
.text()
give innertext of element not tags
.html()
console.log($(".question").html());
.html()
function give inner tags also.
this paragraph <p> , i'm inside tag in question class <h1> , heading </h1> </p>
in case
.html()
fine
Comments
Post a Comment