Hi Gurus
I have the following code:
function CI(ImgN, Alt){
if( document.getEle mentById && document.getEle mentById('il') ){
var d=document.getE lementById('il' );
if(document.cre ateElement){
var i=document.crea teElement('img' );
i.src="i/" + ImgN;
i.className='l' ;
i.alt=Alt;
while(d.firstCh ild!==null){
d.removeChild(d .firstChild);
}
d.appendChild(i );
return false;
}else if(d.innerHTML) {
d.innerHTML='<i mg src="i/' + ImgN + '" class="l" alt="' + Alt + '"
ONCLICK="return XI()">';
return false;
}else {
return true;}
} else {
return true;}
}
I now want to add the onclick event to the img (so that the user can close
it), how do I do that, or can I simply add a bit of text at the bottom of
the image 'close image' (and how do I do that??)?
TIA
- Nicolaas
I have the following code:
function CI(ImgN, Alt){
if( document.getEle mentById && document.getEle mentById('il') ){
var d=document.getE lementById('il' );
if(document.cre ateElement){
var i=document.crea teElement('img' );
i.src="i/" + ImgN;
i.className='l' ;
i.alt=Alt;
while(d.firstCh ild!==null){
d.removeChild(d .firstChild);
}
d.appendChild(i );
return false;
}else if(d.innerHTML) {
d.innerHTML='<i mg src="i/' + ImgN + '" class="l" alt="' + Alt + '"
ONCLICK="return XI()">';
return false;
}else {
return true;}
} else {
return true;}
}
I now want to add the onclick event to the img (so that the user can close
it), how do I do that, or can I simply add a bit of text at the bottom of
the image 'close image' (and how do I do that??)?
TIA
- Nicolaas
Comment