Is there anything wrong with the code? It’s not working.
<script>
t=document.getElementById('good');
document.write(t.value);
</script>
HTML:
Type-here: <input id='good' type='text' value="my value is high">
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re script is at the top of the document, and it runs before your input tag exists in the DOM.
Scripts execute as soon as the browser sees the
</script>closing tag. You can put your script block at the end of the<body>or you can have the code run as an “onload” handler.