How to handle an element if it has no name and no id properties?
<p>I am using some elements (<code>input</code>, <code>select</code>, <code>textarea</code> etc.) to send data from client inputs to server via XHR(ajax). </p>

<p>While processing data and in sending process I give informations to user with modal dialog and block his screen.</p>

<p>After sent success and everythings done right, give "success info" and unblock his screen.</p>

<p>Also I must clean (reset) input fileds. I didn't use form, so I couldn't use <code>reset()</code>.  </p>

<p>I try to doing this with the following JavaScript:</p>

<pre><code>function hedefiSifirla(anacElementID) {
    var anacElement = (nY(anacElementID) ? nY(anacElementID) : anacElementID);

    for (xi, xiLen = anacElement.children.length; xi &lt; xiLen; xi++) {
        var elm = anacElement.children[xi];

        if (elm.hasChildNodes()) {
            hedefiSifirla(elm)
        }

        if ((elm.tagName == 'input' &amp;&amp; elm.type != 'checkbox') || elm.tagName == 'textarea') {
            alert(elm.id);
            elm.value = '';
        }

        if (elm.tagName == 'input' &amp;&amp; elm.type == 'checkbox') {
            elm.checked = false;
            alert(elm.id);
        }

        if (elm.tagName == 'select') {
            elm.options.length = 0;
            alert(elm.id);
        }
    }
}
</code></pre>

<p>This didn't work with any error log. Where did i go wrong?</p>
