0
Q
不能在JS
A
回答
4
getElementsByClassName
返回倍數元素。
因此,您正在訪問它不正確。你想要什麼,在這種情況下,就是:
header[0].style.color = 'red';
// ^[0] will get the first element with the class,
// which is in this case your is header element. [1] would get the second, etc.
相關問題
- 1. 節點JS不能在JS
- 2. 不能在角JS
- 3. 不能與JS
- 4. TrelloApp不能在角JS(routeProvider)
- 5. 不能在節點JS
- 6. 不能在節點JS
- 7. js不能在asp.net工作
- 8. 刪除功能不能在角度JS
- 9. 刪除功能不能在角Js
- 10. 功能不會JS
- 11. 不能在JS,而不是HTML
- 12. Minified JS導致JS不能工作
- 13. http.get不能在angular js中工作2
- 14. console.log不能在JS文件中工作
- 15. 頁面路由不能在角色JS
- 16. Bootstrap JS不能在Rails 4中工作
- 17. JS圖不能顯示在iframe中
- 18. JS警報不能在ColdFusion中運行
- 19. $ location不能在AngularJS中使用d3.js
- 20. JS功能在Chrome而不是Firefox的
- 21. CSS和JS不能在HTTPS中工作?
- 22. JS代碼不能在IE8中工作?
- 23. grunt js不能在windows工作
- 24. d3.js不能在chrome中工作
- 25. JS/jQuery不能在CodePen中工作
- 26. Express JS路由不能在Promise
- 27. JS不能在Internet Explorer中工作
- 28. ng-submit不能在角js中工作
- 29. 選擇js不能在IE8中工作
- 30. js不能在head標籤(蛋糕php)
這是偉大的!謝謝。 – edem
@edem不用擔心男人!樂意效勞 – lifetimes