简体   繁体   中英

I want to set input value

<html>
<head>
</head>
<body>
 <input id="_onSpeech" onBlur="simpleFcs();"> <br>
            <button id="_onSpeechBtn" onClick="resetValue();">Gönder</button>
<script>
function resetValue(){
    document.getElementById("_onSpeech").innerHTML="";
}
</script>
</body>
</html>

I want to set inputs value to NULL or "" (empty) when i click the "_onspeechBtn" I also tried .value option too but its still not working.

 function resetValue(){ document.getElementById("_onSpeech").value=""; }
 <input id="_onSpeech" > <br> <button id="_onSpeechBtn" onClick="resetValue();">Gönder</button>

你的id好像有误。

document.getElementById("_onSpeech").value = "";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM