我试图在课程中找到一个元素" active"并将其班级改为"不活动"。
目前我收到此错误
Dim c As Range, i As Long, n As Long
Set c = Cells(3, 4)
For n = 1 To 10 Step 3
i = n
Do Until i > combos
Range(Cells(i, 10), Cells(i + Defrepeat - 1, 10)) = c.Value
i = i + TErepeat
Loop
Set c = c.Offset(1, 0)
Next n
的javascript:
Cannot set property 'className' of null
HTML:
document.getElementById("active").className = "inactive";
我不相信这个问题是因为我有两个类,因为我尝试从元素中删除<a href="javascript:;" class="paginationlink active" data-page-number="1"></a>
,但我仍然会返回相同的错误。
答案 0 :(得分:-1)
问题是您使用document.getElementById("active")
获取元素,但未定义id="active"
。尝试添加id="active"