JS控制DOM的样式
<style type="text/css">
.offButton {
width: 200px
}
.onButton {
width: 200px;
height: 200px
}
</style>
<button class="offButton" name="saveButton" onclick="getValues()" id="d1">Save</button>
<script type="text/javascript">
function getValues() {
var div = document.getElementById('d1');
div.setAttribute("class", "onButton");
}
<script>
<button class="offButton" name="saveButton" onclick="getValues()" id="d1">Save</button>
<script type="text/javascript">
function getValues() {
var div = document.getElementById('d1');
div.style.backgroundColor = "green";
}
<script>