jquery toggle text on click
$(function(){
$(".pushme").click(function () {
$(this).text(function(i, text){
return text === "PUSH ME" ? "DON'T PUSH ME" : "PUSH ME";
})
});
})
jquery toggle text on click
$(function(){
$(".pushme").click(function () {
$(this).text(function(i, text){
return text === "PUSH ME" ? "DON'T PUSH ME" : "PUSH ME";
})
});
})
javascript when button clicked different text appears
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';
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us