document.getElementById('myElement');
document.querySelector('#myElement');

document.getElementsByClassName('myElement');
document.querySelectorAll('.myElement');

document.getElementsByTagName('div');
document.querySelectorAll('div');

document.querySelectorAll('[data-foo-bar="someval"]')

document.querySelectorAll('#myForm :invalid');

document.getElementById('myParent').children;

document.querySelector('#myParent > [ng-click]');
document.querySelectorAll('#myParent A');
document.querySelectorAll('DIV:not(.ignore)');
document.querySelectorAll('DIV, A, SCRIPT');

CSS3:
p:not(.first) {
color: red;
}
p:not(.first):not(.fourth) {
color: red;
}
元素重1开始,没有0;
p:not(:nth-child(2)):not(:first-child) {
color: red;
}

相关文章:

  • 2021-06-14
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2021-06-14
  • 2022-01-13
  • 2021-05-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-12-23
  • 2021-10-27
  • 2021-10-13
  • 2021-09-04
相关资源
相似解决方案