I am trying to generate an element from variable in jquery. My variable is like below:
var panelheader = "<div class='panel panel-default'><div class='panel-heading pnlbld'>Test</div><div class='panel-body'></div></div>"
I want to change panel-heading text and want to insert in panel-body.
$(panelheader + '.panel-heading').text('Name')
Above statement removes all divs inside panel with text Name. But I want this as panel-heading.
Also, when I tried to insert table between panel-body like below:
$(panelheader + '.panel-body').prepend(mytbl)
It creates table before panel-heading.
I want the "Name" to be in the place of "Test" and mytbl in between
<div class='panel-body'></div>
$(panelheader).find('.panel-heading').text('Name')and same forpanel-body$(panelheader).find('.panel-body').html(myTbl)to put your table as the content ofpanel-body