Priyanka Pachori Priyanka Pachori - 1 year ago 97
HTML Question

Collapse/Open a table with font-awesome icon

Currently my label is collapsible, and it collapses a table. I want to add font-awesome icons with the label or heading; caret-down for table open and caret-right for table closed or collapsed. This should happen on click.

Answer Source

I've created a fiddle here

This could solve your problem


  $('.expand, .collapse').bind('click',function(){


<a href="#" class="expand"><span class="glyphicon glyphicon-chevron-right"></span></a>

<a href="#" class="collapse"><span class="glyphicon glyphicon-chevron-down"></span></a>

<div class="content">
Div Content
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download