p后面如果用class的话,用getElementsByClassName为什么实现不了
<p class="p">hello</p>
document.querySelector(".p").style.color="blue";
<p class="my">hello</p>
document.getElementsByClassName('my')[0].style.color = 'blue';
<p class="my">hello</p>
document.getElementsByClassName('my')[0].style.color = 'red';