<script></script>

 

函数写法:

function  fun_name(){

  x=docment.getElementById("demo");

  x.innerHTML="test change"; 

}

 

getElementById:获取控件id号

 

函数的调用:

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

 

看出函数写法与其他差不多,变量复制用一个等于号,每行结束时候使用分号。。

 

参考地址:

http://www.w3school.com.cn/tiy/t.asp?f=js_intro_inner_html

 

相关文章:

  • 2022-12-23
  • 2021-06-13
  • 2021-04-08
  • 2021-09-08
  • 2022-01-14
猜你喜欢
  • 2022-03-07
  • 2021-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-10-04
  • 2022-01-10
  • 2022-12-23
相关资源
相似解决方案