DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "Img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': 'SayHi(this)' }));
document.body.appendChild(DeCheBX);
DeImg = $('MyDiv').insert(new Element('img', { 'id': "Imgx" + obj[i].Nam, 'src': obj[i].IM }));
document.body.appendChild(DeImg);
}
SayHi = function(x) {
try {
if ($(x).checked == true) {
var y = "Imgx" + 1;
alert(y);
$('y').invoke('hide');
views:
25answers:
1
A:
You are putting something into the y
variable :
var y = "Imgx" + 1;
alert(y);
But, after, you are using the 'y'
string, and not the content of the y
variable :
$('y').invoke('hide');
I suppose you want to use the content of the y
variable, instead :
$(y).invoke('hide');
Pascal MARTIN
2010-04-01 06:20:30
This is not variable infact this is the y =Imgx1....Imgx2...like id of image with that i can hide the image but i dont know it doesnt work
vicky
2010-04-01 06:54:02