I want to change the span's glyphicon following an action.

Html:

```
<div class="btn-group">
    <button type="button" id="statusButton1" class="btn btn-warning text">
        <span id="iconka" class="glyphicon glyphicon-star"></span> На модерации</button>
    <button type="button" id="statusButton2" class="btn btn-warning dropdown-toggle" data-toggle="dropdown">
    <span class="caret"></span>
    <span class="sr-only">Toggle Dropdown</span>
  </button>
  <ul class="dropdown-menu">
    <li><a href="#" id="action-1">На модерации</a></li>
    <li><a href="#" id="action-2">Offline</a></li>
    <li><a href="#" id="action-3">Online</a></li>
    <li><a href="#" id="action-4">В архив</a></li>
  </ul>
</div><!-- /btn-group -->

```

JS:

```
$("#action-1").click(function(){   
//change class of button
  var className = $('#statusButton1').attr('class'); 
  $('#statusButton1').removeClass(className).addClass('btn btn-warning text');                      $('#statusButton2').removeClass(className).addClass('btn btn-warning dropdown-toggle');

    //change class (icon) of button

    var spanClass = $('#iconka').attr('class');
    $('#iconka').removeClass(spanClass).addClass('glyphicon glyphicon-time'); 

// this not working for span

    alert (spanClass);    

});

```

<http://jsfiddle.net/52VtD/2472/>

In example