Select by ID within jQuery object to get text - Javascript jQuery Selector

Javascript examples for jQuery Selector:id

Description

Select by ID within jQuery object to get text

Demo Code

ResultView the demo in separate window


<html>
   <head> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 
   </head> 
   <body> 
      <script>
var final = $("<span id='outer'> Outer Span </span><span id='inner'> Inner Span </span>");

var div = $("<div>").append(final);
console.log($("#inner", div).html());

      </script>  
   </body>/*  w ww .  jav a  2  s  .c om*/
</html>

Related Tutorials