This article mainly introduces how to control Div width, increase, and adjust the background color by clicking the button in javascript. It involves related techniques related to javascript dynamic operation of page element attributes and is applicable to the function of dynamic page skin replacement, for more information about how to adjust the Div width, increase, and background color, see the examples in this article. 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:
Click the button to change the CSS style