Home > Web Front-end > JS Tutorial > body text

Methods to disable and undisable page buttons_javascript skills

WBOY
Release: 2016-05-16 16:59:25
Original
1651 people have browsed it

The concept of timer and delayer
//--Timer
// Timer ID number setInterval(callback function, milliseconds);
// Call the callback function every specified milliseconds

// clearInterval (timer ID number)
// Stop the timer with the specified ID number (actually destroying and releasing resources)

//--Delayer
// Delayer ID number setTimeout (callback function, millisecond interval)
// Starting from the call, wait for the specified number of milliseconds and call the callback function once, then end
// Use clearTimeout to clear the delayer

Rendering:

After the page is opened, the following picture will appear: After that, the button value value will decrease by 1 every 1 second until 0. The stop button content will change to agree

Methods to disable and undisable page buttons_javascript skills

Implementation code:

Copy code The code is as follows:



< ;html xmlns="http://www.w3.org/1999/xhtml">









Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template