実行

来源:互联网 发布:mac格式化ntfs格式 编辑:程序博客网 时间:2024/06/04 19:09
<!DOCTYPE html>
<html>
<head>


<script>


function reWrite(num)
{
  if (document.getElementById)
  {
    if (num==0)
    {
      document.getElementById("str").textContent="<b>テキスト</b>の書換え";
    }
    else
    {
      document.getElementById("str").innerHTML="<b>タグ</b>を含む書換え";
    }  
  }
}


</script>
</head>
<body>
<form>
<input type="button" value="テキスト" onclick="reWrite(0)">
<input type="button" value="HTMLタグ" onclick="reWrite(1)">
</form>


<div id="str">このタグの中身を書き換えます。</div>




</body>
</html>
原创粉丝点击