// 选择<p>JavaScript</p>:
var js = document.querySelector('#test-p');
// 选择<p>Python</p>,<p>Ruby</p>,<p>Swift</p>:
var arr = document.querySelectorAll('.c-red')[1].children
// 选择<p>Haskell</p>:
var haskell = document.querySelectorAll('.c-green')[1].lastElementChild
Sign in to make a reply
time cure
// 选择<p>JavaScript</p>:
var js = document.querySelector('#test-p');
// 选择<p>Python</p>,<p>Ruby</p>,<p>Swift</p>:
var arr = document.querySelectorAll('.c-red')[1].children
// 选择<p>Haskell</p>:
var haskell = document.querySelectorAll('.c-green')[1].lastElementChild