A
annoyingmouse
Is it possible to use javascript to add javascript to a DOM object?
I've the following code to add an image to a page:
function flagError(id){
var image = document.createElement('img');
image.alt = "error";
image.src = "./resources/errorNew.gif";
var uncle = getUncle(id);
if(!first_child(uncle)){
uncle.appendChild(image);
}
}
what I want to do is use wz_tooltip to add a nice tooltip to the image.
The end result would be something like this:
<img src="./resources/errorNew.gif" alt="error" onmouseover="return
escape('Repition.');"/>
I've looked at doing it via:
image.onmouseover = "\"return escape('Repition.');\"";
but that doesn't seem to work at all... any ideas anyone?
Cheers,
Dom
I've the following code to add an image to a page:
function flagError(id){
var image = document.createElement('img');
image.alt = "error";
image.src = "./resources/errorNew.gif";
var uncle = getUncle(id);
if(!first_child(uncle)){
uncle.appendChild(image);
}
}
what I want to do is use wz_tooltip to add a nice tooltip to the image.
The end result would be something like this:
<img src="./resources/errorNew.gif" alt="error" onmouseover="return
escape('Repition.');"/>
I've looked at doing it via:
image.onmouseover = "\"return escape('Repition.');\"";
but that doesn't seem to work at all... any ideas anyone?
Cheers,
Dom