how to get id from .html() in jquery
<p>following is my code i want to access "course-type" id from .htm() method how to access that id</p>

<pre><code> $("#question-type").html("&lt;option&gt;Select&lt;/option&gt;&lt;option&gt;Excel Sheet&lt;/option&gt;&lt;option&gt;One by One&lt;/option&gt;");

$("#question-type").change(function(){
    $("#course").html("&lt;label&gt;Select course &lt;/label&gt;&lt;select id='course-type'&gt;&lt;option&gt;Course 1&lt;/option&gt;&lt;option&gt;Course 2&lt;/option&gt;&lt;option&gt;Course 3&lt;/option&gt;&lt;/select&gt;");
});

$("#course-type").change(function(){

    $("#subject").html("&lt;label&gt;Select subject &lt;/label&gt;&lt;select id='subject-type'&gt;&lt;option&gt;Subject 1&lt;/option&gt;&lt;option&gt;Subject 2&lt;/option&gt;&lt;option&gt;Subject 3&lt;/option&gt;&lt;/select&gt;");
});
</code></pre>
