DHTML replacing <input type="text" with value
Posted: Wed Apr 25, 2012 2:52 am
I have an HTML
<tr>
<td class="main">Products Name:</td>
<td class="main" id=pn0><img src="/catalog/includes/languages/english/images/icon.gif" border="0" alt="English" title="English"> <input type="text" name="products_name[1]" /></td>
</tr>
which I would like to replace using
document.getElementById("pn0").innerHTML='<img src="/catalog/includes/languages/english/images/icon.gif" border="0" alt="English" title="English"> <input type="text" name="products_name[1] value="title" />';
to give the input field an initial value. But it seems does not work. The value="title" simply do not appear.
Why? How should I do?
<tr>
<td class="main">Products Name:</td>
<td class="main" id=pn0><img src="/catalog/includes/languages/english/images/icon.gif" border="0" alt="English" title="English"> <input type="text" name="products_name[1]" /></td>
</tr>
which I would like to replace using
document.getElementById("pn0").innerHTML='<img src="/catalog/includes/languages/english/images/icon.gif" border="0" alt="English" title="English"> <input type="text" name="products_name[1] value="title" />';
to give the input field an initial value. But it seems does not work. The value="title" simply do not appear.
Why? How should I do?