获得id为week的按钮 点击按钮的时候,希望按钮增加多个类名,jquery好实现,那js除了这样一个一个的加还有没有比较方便的方法么?
<script>
window.onload = week; function week(){ var weeks = document.getElementById("week"); var table = document.getElementById("table"); var table2 = document.getElementById("table2"); var text = document.getElementById("text"); table2.className = fix; weeks.onclick = function(){ weeks.className = 'show'; weeks.className = 'week'; table.className = 'fix'; } text.change = function(){ weeks.className = 'fix'; weeks.className = 'week'; table.className = 'show'; } } </script>
相关分类