All pastes #420696 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-02 10:14 UTC
rendered paste body
// this function is called from a <img [...] onmouseover='displayPict(this);'> generated previously with innerHTML

function displayPict(me){
	alert("document : "+document.getElementsByTagName('body')[0].tagName);
	// returns "body"
	myDisplayDiv = window.document.createElement("div");
	myDisplayDiv.id="displayDiv";
	myDisplayDiv.width="150px";
	myDisplayDiv.height="150px";
	myDisplayDiv.innerHTML="test";
	window.document.getElementsByTagName("body")[0].appendChild(myDisplayDiv);
	alert("my div : " + document.getElementById('displayDiv'));
// returns "null"
}