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?
DHTML replacing <input type="text" with value
Moderator: General Moderators
Re: DHTML replacing <input type="text" with value
you do not have the closing quote for the name attribute. Any reason why not just give the input an id and then do:
document.getElementById('inputID').value = "title";
-Greg
document.getElementById('inputID').value = "title";
-Greg