Created
February 12, 2015 02:29
-
-
Save bryanjamesmiller/a30ff89144b8446774a0 to your computer and use it in GitHub Desktop.
another way
This file contains 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
$(document).ready(function(){ | |
$('button').click(function() { | |
var $button = $(this), | |
test = $button.text() === 'Expand', | |
test2 = $button.text() === 'Collapse'; | |
if(test) | |
{ | |
$button.text('Collapse'); | |
} | |
else if(test2) | |
{ | |
$button.text('Expand'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment