Forum Moderators: open
var bodyTag=window.content.document.getElementsByTagName("body")[0];
var bookmarkDiv=document.createElement("div");
bookmarkDiv.setAttribute("id","divHighlited1");
bookmarkDiv.setAttribute("style","position:absolute;top:5px;left:25px;height:20;width:20");
bodyTag.appendChild(bookmarkDiv);
var divHighlited=document.getElementById("divHighlited1");
but variable divHighlited keep returning null.
The above code does create a DIV with all attributes:
<div style="position: absolute; top: 5px; left: 25px;" id="divHighlited1"></div></body>