recherche

Maison  >  Questions et réponses  >  le corps du texte

为什么不能通过getElementsTagName的方式改变文本的颜色?

为什么不能通过getElementsTagName的方式改变文本的颜色?

phpcn_u238phpcn_u2382995 Il y a quelques jours951

répondre à tous(1)je répondrai

  • 阿神

    阿神2016-12-21 16:27:51

    getElementsByName和getElementsByTagName获取的是一个由dom元素组成的数组。数组是无法直接用style属性来设置的,得先循环遍历这个数组,一项项取得dom元素再赋予style属性

    répondre
    0
  • Annulerrépondre