I have HTML something like this
<div id="foo">
<select>
<option> one </option>
</select>
</div>
when I use
document.getElementById('foo').innerHTML = document.getElementById('foo').innerHTML.replace("<option> one </option>", "<option> two </option>") ;
The innerHTML get replaced but it does not get reflected in the browser.
If I alert innerHTML I can see that it has been changed now but in the browser it still shows old option.
Is there any way to make this change recognized by the browser ?
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…