Get the text content of <p>. - Javascript jQuery

Javascript examples for jQuery:Text

Description

Get the text content of <p>.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    console.log($("p").text());
});//from   ww w  . j a v  a  2s . c  o m
</script>
</head>
<body>

<p>This is some text.</p>

</body>
</html>

Related Tutorials