Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ButtonPhoneApp/js/main.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
13 lines (13 sloc)
409 Bytes
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() { | |
//toggle class of background when you click the button | |
$(".thebutton").click(function() { | |
$(this).toggleClass("voidfilled"); | |
}); | |
}); | |
//change the text that appears when you click the button | |
$(".thebutton").on("click", function() { | |
var el = $(this); | |
el.text() == el.data("text-swap") ? | |
el.text(el.data("text-original")) : | |
el.text(el.data("text-swap")); | |
}); |