I'm trying to get value from the input box. The id is correct and input is shown. In console it shows an
UncaughtTypeError Uncaught TypeError: Cannot read property 'value' of undefined and links to line 41 but all is correct as I think.
HTML
<input id="numbern" name="nub" placeholder="Your Roll No." class="form-control col-6" autocomplete="off">
Javascript
docsd=document.getElementById('numbern');
console.log(docsd.value);
Can I know what I'm doing wrong?