JS implementation click button control Div width, increase and adjust the background color method, jsdiv
This article describes how to adjust the Div width, increase, and background color by clicking the button in JavaScript. Share it with you for your reference. The details are as follows:
Here, we use JavaScript to change the height, width, and background color of the DiV after clicking the button. Click the corresponding button to adjust the height, width, and background color of the Div. In implementation, JS is used to control the CSS style file after clicking the button. All of this is under the dynamic control of JS, such as the implementation of the Refreshing Web Page Style switching, it can be expanded on this basis.
Shows the running effect:
The Code is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I hope this article will help you design javascript programs.