1$("button").click(function(){
2 $(this).text($(this).text() == 'Show' ? 'Close' : 'Show');
3});
1$(function(){
2 $(".pushme").click(function () {
3 $(this).text(function(i, text){
4 return text === "PUSH ME" ? "DON'T PUSH ME" : "PUSH ME";
5 })
6 });
7})
1 function show() {
2 // get the box
3 var box = document.getElementById('box');
4
5 // get the current value of the box's display property
6 var displaySetting = myClock.style.display;
7
8 // also get the box button, so we can change what it says
9 var showButton = document.getElementById('showButton');
10
11 // now toggle the box and the button text, depending on current state
12 if (displaySetting == 'block') {
13 // box is visible. hide it
14 myClock.style.display = 'none';
15 // change button text
16 clockButton.innerHTML = 'Show box';
17 }
18 else {
19 // box is hidden. show it
20 myClock.style.display = 'block';
21 // change button text
22 clockButton.innerHTML = 'Hide box';
23 }
24 }
25
1 $(".email-slide").click(function(){
2 $("#panel").slideToggle("slow");
3 $(this)
4 .text("Close")
5 .toggleClass("active");
6});