34
rated 0 times
[
40]
[
6]
/ answers: 1 / hits: 30347
/ 13 Years ago, fri, may 27, 2011, 12:00:00
I have created a label
element. I need to add onclick
event to that...
function a(me) {
var d=document.createElement(label);
d.id=me.id;
d.onClick=a(10);
d.innerHTML=welcome;
document.body.appendChild(d);
}
HTML:
<label id=1 onclick=a(this)>aa</label>
<label id=2 onclick=a(this)>bb</label>
<label id=3 onclick=a(this)>aa</label>
actually what happens is when i click the any of three labels in html. another label is created and displays welcome. now when i click the newly created label welcome it does not display anything...... that is the onclick event added to newly created label is not working ....... any suggestion.................
More From » javascript