Can't create input when data null with javascript
<p>I have a sample code</p>

<pre><code>&lt;script type="text/javascript"&gt;
function remove_news(id) {
    try {
        $('news_list').removeChild($('news_'+id));
        $('news_list').removeChild($('input_news_'+id));
        if($('news_list') == '') {
            var input = document.createElement('input');
            input.setAttribute("type", "hidden");
            input.setAttribute("name", "news_id");
            input.setAttribute("value", "0");
            document.getElementById("news_list").appendChild(input);
        }
    } catch(err){}
}
&lt;/script&gt;
&lt;div id="news_list"&gt;
&lt;div id='news_1'&gt; News no 1 &lt;a href='#' onclick='remove_news(1); return false;'&gt;[Delete]&lt;/a&gt;&lt;/div&gt;
&lt;input type="hidden" id="input_news_1" name="news_id" value="1" /&gt;
&lt;/div&gt;
</code></pre>

<p>When I run code, chose delete link is result not show <code>&lt;input type="hidden" name="news_id" value="0" /&gt;</code></p>

<p>How to fix it ?</p>
