Getting and setting the value from input use javascript
<p>I have a input from website which defines like this:</p>

<pre><code>&lt;input type="text" name="postdb[title]" size="60" value id="title" class="input_text"&gt;
</code></pre>

<p>I've tried this:</p>

<pre><code>document.getElementsByName('postdb[title]')[0].value='test'
</code></pre>

<p>and this:</p>

<pre><code>document.getElementById('title').value='test'
</code></pre>

<p>but it doesn't work,how to set the value of this input use javascript?</p>

<p>edit:</p>

<p>I found that this input is insideof <code>&lt;form name="FORM..</code>,so how to find it in that form use javascript?</p>

<p>edit:solved;
its actually inside of FORM from iframe,so I just use this:</p>

<pre><code>var vform =document.frames['main'].document.forms['FORM'];
vform.elements['title'].value='test'; thanks for help,
</code></pre>
