Rome hotels - Wordpress Theme - Online Advertising - Credit Reports - Debt Consolidation

PDA

View Full Version : I have calling onclick event problem in dynamic label in .js


htetlinsu
Jul 9th 2008, 12:09 am
i want to call function when i click dynamic label in js file
my code sample is here!

var output='<form><table><tr>';
for(var i=1;i<=page;i++){
//var pgno=String(i);

output+='<td><label id=\"'+i+'\"/ onclick=\"Display();\">'+i+'</td>';

}
output+='</tr></table></form>';
document.write(output);
function display(){
document.write("hello");
}


but onclick event doesn't work.how can i call onclick event .:confused:

xlcho
Jul 9th 2008, 1:20 am
You have a syntax error in the func name. It should be display(), not Display();

htetlinsu
Jul 10th 2008, 1:57 am
yes.i change this syntax error but it does not active this onclick event.how can i do?please help me.