How to add a select list with options to a DOM element using jQuery
<p>Today I try to make a dynamic dropdownlist using jQuery. I only provide one select list on the page at started. After usser selecting a option, if the selected category has sub categories, one new select list will be added next to the original select list by jQuery.</p>

<p>But I don't know how to implement my idea. How to add a select list and add options to the select list, finally add it to page using jQuery.</p>

<p>My codes are below:</p>

<pre><code>$.getJSON(
    '/Work/Content/Categories/' + currentValue,
    '{Id:Name}',
    function (data) {
        if (data.length &gt; 0) {
            $current.append('&lt;select&gt;&lt;/select&gt;');
            $selectList = $('fieldset &gt; select:last');
            $.each(data, function (index, value) {
                var option = new Option(value.Id, value.Name);
                if ($.browser.msie)
                    $selectList.add(option);
                else
                    $selectList.add(option, null);
            });
        }
    }
);
</code></pre>

<p>Thanks every body.</p>
