views:

25

answers:

1
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');
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
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