i want to make an input disappear if javascript is disabled, i have tried,
<script>
document.getelementbyid('mydiv').innerhtml= <input type=text>;
</script>
<div id="mydiv"></div>
so that if javascript is disabled the code will not put the input in the div
but in my browser console it says document.getelementbyid('myinput') is undefined, but if i put in a function my browser console doesn't say anything is there a way i can make a function run immediately the page is loaded or to make the input show only when javascript is enabled