Skip to content

Instantly share code, notes, and snippets.

@aleksandar-b
Last active May 26, 2016 19:28
Show Gist options
  • Save aleksandar-b/ab7d53e15135c72f992093adf27b711d to your computer and use it in GitHub Desktop.
Save aleksandar-b/ab7d53e15135c72f992093adf27b711d to your computer and use it in GitHub Desktop.
// /*jslint browser: true*/
// /*global $, jQuery, alert*/
// /*jshint strict: true */
// /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
//
var counter = 0;
$(document).ready(function () {
$('.clickable').on('click',function(){
if(counter%2 === 0){
$(this)
.find(".glyphicon-plus")
.removeClass("glyphicon-plus")
.addClass("glyphicon-minus");
}else{
$(this)
.find(".glyphicon-minus")
.removeClass("glyphicon-minus")
.addClass("glyphicon-plus");
}
counter++;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment