hello i'm trying to create anchor tag in javascript-
var div1=document.getElementById("tabarea"); var tab=document.createElement("a"); tab.setAttribute("class","tab"); tab.setAttribute("href","a.html"); tab.innerHTML="<a class=\""+"tab"+"href=\""+"a.html"+"\></a>" div1.appendChild(tab);
here i'm trying to add a tab dynamically(which is my custom tag,created using 'a' tag ) to my tab area.if i add text,button it gets added, but 'a' tag :( can anyone please help?
Comment
hello i'm trying to create anchor tag in javascript-
var div1=document.getElementById("tabarea");
var tab=document.createElement("a");
tab.setAttribute("class","tab");
tab.setAttribute("href","a.html");
tab.innerHTML="<a class=\""+"tab"+"href=\""+"a.html"+"\></a>"
div1.appendChild(tab);
here i'm trying to add a tab dynamically(which is my custom tag,created using 'a' tag ) to my tab area.if i add text,button it gets added, but 'a' tag :(
can anyone please help?