I want to write something in:
<input type="text" id="total">
With
document.getElementById('total').innerHTML = 'hi';
But it is not writing anything in text box.
Even I also tried it with className
but still not working.
Is there any solution?
<html>
<body>
<h2>My First JavaScript</h2>
<input type="text" id="total" >
<script>
document.getElementById('total').innerHTML = 'hi';
</script>
</body>
</html>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…