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';
}
}
Also in JavaScript:
- minimum number of swaps to sort an array javascript
- $.fn.dataTable.tables in container
- create dynamic fields in react
- import path nodejs
- The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://localhost')
- npm ERR! 503 Service Unavailable: npm@latest
- disable long press on chrome
- js append to array
- javascript load image programmatically
- google docs api word count
- javascript get second last element in array
- ternary operator in angular
- get a user input react
- javascript onsubmit change input value
- convert number to indian rupee format in javascript
- class extends
- how to draw a triangle using javascript
- javascript fetch json
- javascript show stack trace
- how to check palindrome in javascript for lowercase and uppercase
- how to access router from the store vue
- how to create react app using yarn
- javascript code to loop through array
- js comparison operators