<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<script type="text/javascript">
function tbl(){
  if (t=document.getElementById("tbl1")){
    var ot = t.rows[0].cells[0]
    ot.onclick = function (){location="http://www.xxx.com"}
    ot.innerHTML = "<img scr=\"hello.jpg\" width=100 height=30>"
  }
}
window.attachEvent("onload",tbl)
</script>
</head>
<body>
<table width=100% cellspacing=0 cellpadding=0 border=0>
<tr><td> </td></tr>
</table>
</body>
</html>


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
附:修改某个标签代码片段
  var   o=document.getElementsByTagName("HTML")  
  o[0].setAttribute("xmlns:v","urn:schemas-microsoft-com:vml")

效果:<html   xmlns:v="urn:schemas-microsoft-com:vml"> 
函数里加如下语句查看:  
  alert(document.documentElement.outerHTML)

相关文章:

  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2021-07-13
  • 2021-04-20
  • 2022-12-23
猜你喜欢
  • 2022-01-12
  • 2021-11-29
  • 2021-12-26
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
相关资源
相似解决方案