我怎样才能为JavaScript准备课程?

时间:2015-07-15 20:13:23

标签: javascript html

这是我的班级:

.yt-card.yt-uix-expander .yt-uix-button-expander, .yt-card .yt-uix-expander .yt-uix-button-expander

有没有办法把它写得很好:

document.getElementsByClassName("class");

1 个答案:

答案 0 :(得分:2)

var matches = document.querySelectorAll(
    ".yt-card.yt-uix-expander .yt-uix-button-expander, .yt-card .yt-uix-expander .yt-uix-button-expander");