This is function that i created for clear text fields but when enter any custom values it doesn't clear
function clear(){
document.getElementById('bmw1').value="";
document.getElementById('bmw2').value="";
document.getElementById('ans').value="";
}
The fields which created in html
<input type="text" id="bmw1" placeholder="Enter 1st Number"/>
<input type="text" id="bmw2" placeholder="Enter 2nd Number"/>
<input type="text" id="ans" placeholder="Answer"/>
<button type="button" onClick="clear()">Clear Values</button>