1

In jQuery, I have created a dynamic tab named closedable-tab. I want to have a "close" icon showm in this tab, and if I click it, the tab will be closed.

How to implement that?

<ul class="nav nav-tabs">
  <li role="presentation" class="">
    <a class="tabs-li" href="/online_issues/index">tab1</a>
  </li>
  <li role="presentation">
    <a class="tabs-li" href="/online_issues/index">tab2</a>
  </li>
  <li role="presentation">
    <a class="tabs-li" href="/online_issues/index">tab3</a>
  </li>
  <li role="presentation">
    <a class="tabs-li" href="/online_issues/index">tab4</a>
  </li>
  <li role="presentation" class="active"> 
    <a class="tabs-li closeable-tab-li" href="/online_issues/index">closeable-tab</a>
  </li>  
</ul>

Below is an image illustrating the desired result:

enter image description here

Drenmi
  • 8,492
  • 4
  • 42
  • 51
mainframer
  • 20,411
  • 12
  • 49
  • 68

1 Answers1

1

The manipulation tab maybe what you want: https://jqueryui.com/tabs/#manipulation

Natural Lam
  • 732
  • 4
  • 13