11

I am using Twiter Bootstrap Tabs on my page. I want to dynamically add tabs in the view. Currently I am using this code, which is not working

$('#tab').append('<li><a href="#tabname" data-toggle="tab">Tab Name</a></li>');
$('#myTabContent').append('<div class="tab-pane fade in active" id="tabname"><p>tab content</p></div>');
$('#tab a:last').tab('show');

Can Any body tell me what I am missing?

Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746
Saqib
  • 2,470
  • 3
  • 19
  • 32
  • having same issue. when I append
  • to the tab list, it adds the element but strips out the id field and innerHTML. If i find a solution i shall return
  • – jdennison Apr 13 '12 at 16:42