So I have this code. And I want to accomplish something probably simple for javascript guys. If a certain option is selected then add an input field on a div.
<select name="amount" >
<option value="50">50$</option>
<option value="100">100$</option>
<option value="Other">Other</option>
</select>
<div id="custom_price">
</div>
So I want to add the input field once the 'Other' option is selected. I know there's a simple way around this but I cannot make it work:
document.getElementById('custom_price').innerHTML += "<input type="text" name="amount"/>"
So custom_div would look like:
<div id="custom_price">
Custom price:<br>
<input type="text" name="amount"/>
</div>