Why style is null?

Online test https://jsfiddle.net/9qtfyp24/1/
When getting the property value generates an error: Uncaught TypeError: Cannot read property 'style' of null
CSS/HTML
#myid{
 background: #7f8bff;
}
<input id="myid" type="hidden" name="zum" value="8">


JS
var prop = document.getElementById(myid).style.background;
console.log(prop);
June 14th 19 at 20:32
2 answers
June 14th 19 at 20:34
Solution
June 14th 19 at 20:36
Solution
That's so

Find more questions by tags JavaScript