<h1 > this is testing test</h1>

 

<script>

function changecolor(){

      element=document.ElementByID("domo");

  element.style.color="#ff0000";

}

</script>

 

<button  type="button" onclick="changecolor()">点击我</button>

 

说明:

  按钮点击事件触发函数changecolor给id为domo的元素加上style=”color:#ff0000“ ,也可直接在<h1 style="color:#ff0000">

 

相关文章:

  • 2021-12-19
  • 2021-12-31
  • 2021-06-27
  • 2022-01-23
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-27
  • 2021-12-19
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
相关资源
相似解决方案