Javascript examples for jQuery:Text
show all p elements' text
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.3.js"></script> <script type="text/javascript"> $(window).load(function(){//w ww . jav a2 s .c o m $("document").ready(function(){ var data = ''; $("p").each(function(){ data += $(this).html(); }); console.log(data); }); }); </script> </head> <body> <p> Deneme </p> <p> Deneme2 </p> </body> </html>