显示这行代码出错了?att.setAttribute("class","one");
<button id = "id" type="button" name="a">你好,我是宝宝</button>
<script>
var att = document.getElementsByName("a");
att.setAttribute("class","one");
</script>
<style>
.one{
color: red;
}
<button id = "id" type="button" name="a">你好,我是宝宝</button>
<script>
var att = document.getElementsByName("a");
att.setAttribute("class","one");
</script>
<style>
.one{
color: red;
}
2021-07-23
举报