JQuery find() on object created from a string - Javascript jQuery

Javascript examples for jQuery:String

Description

JQuery find() on object created from a string

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.2.js"></script> 
  <script type="text/javascript">
    $(function(){//from w w w  .java 2s  .co  m
var html= '<select name="id"></select>';
var $select = $('<div></div>').append(html);
$select.find('select').append('<option value="1">Test</option>');
console.log($select.html());
    });

      </script> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials