I am creating labels using javascript in my work.It is working fine in google chrome but its not working in Mozilla firefox. And the version of firefox is 4.0 which is latest one..bu still its not working..what is the solution for this? Here is example code...Like this there are so many situations where i create labels in js.But firefox is not supprorting..why? Help me pls...Example code is:-
var placeHereHeader=document.getElementById("placeLabel");
var HeadLabel=document.createElement("label");
HeadLabel.setAttribute("id","LabelHeader");
placeHereHeader.appendChild(HeadLabel);
This is an old question, but never answered.
http://jsfiddle.net/bL6sf/ shows it indeed works, but I have the newer version than Firefox 4.0.
Maybe you didn't see the label because you didn't put any text or html inside it?
var placeHereHeader=document.getElementById("placeLabel");
var HeadLabel=document.createElement("label");
HeadLabel.innerHTML = "My kickass label";
HeadLabel.setAttribute("id","LabelHeader");
placeHereHeader.appendChild(HeadLabel);