如何用JAVASCRIPT添加标签?
<html>
<head>
<title> </title>
<script language="javascript">
var initTop=document.body.offsetHeight;
function init()
{
document.write(" <div id=layer1 style='position:absolute; width:196px; top:initTop;height:52px;z-index:1;background-color:red;'> </div>")
}
</script>
<style type="text/css">
</style>
</head>
<body onload=init()>
</body>
</html>
我是这么添加,可是结果不对,请问有什么方法可以在脚本中添加标签吗?
这样创建是可以的
document.body.offsetHeight,这个错了,没这个属性的,去掉你就看到你创建的了
Web 开发常用手册
JScript语言参考.rar
http://download.csdn.net/source/308916
DHTML参考手册.rar
http://download.csdn.net/source/308913
样式表中文手册.chm
http://download.csdn.net/source/304124
谢谢大家,明白了。
相关问答:
这个表单的数值不是固定的!当按下停止按钮的时候最终的数字才会停在上面!
我想把最后停下的数字传送传送到下一个ASP页面上去!
不想使用location.href="mnn.asp?action="+ok1这样的方式传送过去
......
各位好:
有关疑问是这样的:
我在页面里面加了一段JS的代码中有个函数,大概如下:
JScript code:
<script language = javascript>
function test()
{
alert("testOK");
......
想了很长时间一直没搞定,比较郁闷,不知道大家有什么办法
问题:
使用javascript屏蔽【当前窗口】的菜单栏和工具栏
注意:上面说的是当前浏览器窗口,不是open打开的新的窗口,那样是很容易实现的 ......
就是在服务器上进行操作,所以也不存在程序在那台机器上的问题。
<head>
<script language="javascript">
function Runexe(strPath) {
try {
var obj ......
<%
while not rsapp.eof
%>
<td> <%=rsapp("state")%> </td>
<input name="" value="查看明细" type="button" o ......