javascript拾掇

用javascript如何给span赋值呢?一般有两种方法:

1>输出html

<body onload="s()">
<span id="hello"></span>

<script language="javascript">
  function s(){
document.getElementById("hello").innerHTML = "<iframe src=  height=400 width=300></iframe>";

}
  </script>

2>输出文本

<body onload="s()">
<span id="hello"></span>

<script language="javascript">
  function s(){
document.getElementById("hello").innerText = "hello world";

}
</script>

http://www.fengfly.com/plus/view-40155-1.html

上一篇:Spring学习(五)——Spring注解(一)


下一篇:apache本地和局域网访问设置