Need .innerHTML functionality but with the current form field values including input, select (selected option), and textarea.
So, given:
<form id=f>
<input type=text name=x />
<select name=y>
<option value='1'>one</option>
<option value='2'>two</option>
</select>
</form>
if user enters 123, and selects option two, normal f.innerHTML returns:
<input type=text name=x />
<select name=y>
<option value='1'>one</option>
<option value='2'>two</option>
</select>
I'd like f.magicInnerHTML to return:
<input type=text name=x value='123' />
<select name=y>
<option value='1'>one</option>
<option value='2' selected>two</option>
</select>
reflecting the current form values.
See Question&Answers more detail:os