Is it possible to change input field using javascript onclick?? My code:
<form> <input type="text" id="demo" value="John"> </form> <button onclick="myFunction()">Click me!</button> <script> function myFunction() { document.getElementById("demo").value = "Hello World"; } </script>
it is successful to change the text, but it is failed to change input field value anyidea how to solve it??? Thank you very much
没有评论:
发表评论