Code:
DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "Img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': SayHi(id) }));
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)
{
alert("press" + x);
}
}
catch (e) {
alert("error");
}
};