jquery toggle text on click
$(function(){
$(".pushme").click(function () {
$(this).text(function(i, text){
return text === "PUSH ME" ? "DON'T PUSH ME" : "PUSH ME";
})
});
}) function show() {
// get the box
var box = document.getElementById('box');
// get the current value of the box's display property
var displaySetting = myClock.style.display;
// also get the box button, so we can change what it says
var showButton = document.getElementById('showButton');
// now toggle the box and the button text, depending on current state
if (displaySetting == 'block') {
// box is visible. hide it
myClock.style.display = 'none';
// change button text
clockButton.innerHTML = 'Show box';
}
else {
// box is hidden. show it
myClock.style.display = 'block';
// change button text
clockButton.innerHTML = 'Hide box';
}
}
$("button").click(function(){
$(this).text($(this).text() == 'Show' ? 'Close' : 'Show');
}); $(".email-slide").click(function(){
$("#panel").slideToggle("slow");
$(this)
.text("Close")
.toggleClass("active");
});
Also in JavaScript:
- if statement javascript one line ?
- ClassNotFoundException: com.fasterxml.jackson.core.JsonGenerator
- make angular to run on a different port
- if condition to whether json object has jsonarray or jsonobject
- js string have number js
- useRef() in react
- renemane object key js
- catch javascript
- find a string in an array javascript
- react can only work with node and express? true or false
- create eventlistener to close webpage js
- javascript element read attribute
- pxijs text
- sequelize where more than
- insert element at beginning of array javascript
- angular cli skip-tests
- vue toggle boolean on click
- notice before reload js
- hwo to make ana array of prime numbers in javascript
- express router file
- reacts mos twanted
- Exception in thread "main" org.openqa.selenium.JavascriptException: cannot read getPlayerState
- javascript multiple startswith
- jquery number format comma