html - jquery dynamically edit tabs -


i kind of new jquery. using jquery tabs , have few buttons. need when every button pressed tabs changed dynamically. example @ loading page tabs are

<ul id="featured_tabs">       <li><a href="#fc1" style="width: 454px">tab1/a></li>       <li class="last"><a href="#fc2" style="width: 454px">tab2</a></li> </ul> 

but when button pressed become

<ul id="featured_tabs">       <li><a href="#fc1" style="width: 454px">another tab1/a></li>       <li><a href="#fc1" style="width: 454px">another tab2/a></li>       <li class="last"><a href="#fc2" style="width: 454px">another tab3</a></li> </ul> 

i have tried function set innerhtml of featured_tabs not work right. suggestions ?

try code :

$('button').click(function(){     $('#featured_tabs').append('<li><a href="#fc3" style="width: 454px">another tab3</a></li>')     $('#featured_tabs li').removeclass('last').last().addclass('last') }) 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -