javascript - Give href value to a div -


i'm using bootstrap accordion , has code:

 <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" href="#collapseone"> 

i want create accordion dynamically, can't set .href value div in javascript.

var accordionhead = document.createelement("div"); accordionhead.classname = "panel-heading"; accordionhead.dataset.parent = "#accordion"; accordionhead.dataset.toggle = "collapse"; accordionhead.href = "#id_"+player.pos; 

every other option valued, not .href , accordion not working. there other option give .href value div?

var accordionhead = document.createelement("div"); accordionhead.classname = "panel-heading"; accordionhead.dataset.parent = "#accordion"; accordionhead.dataset.toggle = "collapse"; accordionhead.setattribute("href","#id_"+player.pos);` 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -