Last active
December 17, 2015 04:38
-
-
Save brianbroken/5551715 to your computer and use it in GitHub Desktop.
jQuery: Add Current span to active li
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('ul li a.active').prepend('<span class="activeSpan">Test - </span>'); | |
$('ul li a').click(function(){ | |
var activeSpan = $('.activeSpan').remove(); | |
$(this).prepend(activeSpan); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment