Javascript examples for jQuery:Text
Append text into detached html
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.10.1.js"></script> <script type="text/javascript"> $(window).load(function(){/*from ww w. j a va 2 s .co m*/ $( document ).ready(function() { text = '<p>One</p><p>Two</p><p>Three</p>'; console.log($(text).filter('p').length); }); }); </script> </head> <body> </body> </html>