How to give a value of 1 to a textbox with a class
<p>I want to know if the code below removes all <code>input type='text'</code> values back to <code>""</code>:</p>

<pre><code>var inp = document.getElementsByTagName('input');
for (var i = inp.length - 1; i &gt;= 0; i--) {
    if ('text' === inp[i].type) inp[i].value = "";
}
</code></pre>

<p>Then I want to know if I have an <code>input</code> which is <code>type='text'</code> but which <code>class</code> is <code>.num_questions</code>. How can I code that so that it looks for the class name and gives it a value of <code>"1"</code>? </p>
