I am having a div
and using javascript to set attribute for it with the below code
Javascript
var m = document.getElementById('d1');
m.setAttribute("height","50%");
but it throws an error as setAttribute()
property cannot be set to the null reference.
My HTML Code
<div id="d1" style:"background-color:blue;">