Javascript examples for jQuery:Json
get the last <P> in JSON object
<html> <head> <title>SO - 14805660</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(window).load(function(){/*from w w w .ja v a2 s . c o m*/ var x = $('<P>item 1</P><P>item 2</P><P>item 3</P>'); console.log(x); console.log(x.filter('p')) console.log(x.filter('p:last')) console.log(x.filter('p').last()) }); </script> </head> <body> </body> </html>