JavaScript代码在网页读取到该语句的时候就会执行;
而如果是通过事件调用执行的function那么对位置没什么要求的。
而如果是通过事件调用执行的function那么对位置没什么要求的。
2015-04-28
document.write("hello");
document.getElementById("p1").style.color="blue";
document.getElementById("p1").style.color="blue";
2015-04-28
//定义"隐藏内容"的函数
function hden()
{ch.style.display="none";}
//定义"显示内容"的函数
function sho()
{ch.style.display="block"}
//定义"取消设置"的函数
function cancel()
{var ch=confirm("确定取消设置?")
if(ch==true)
{ txt.removeAttribute('style');
}
else
{}}
function hden()
{ch.style.display="none";}
//定义"显示内容"的函数
function sho()
{ch.style.display="block"}
//定义"取消设置"的函数
function cancel()
{var ch=confirm("确定取消设置?")
if(ch==true)
{ txt.removeAttribute('style');
}
else
{}}
//定义"改变颜色"的函数
var ch=document.getElementById("txt");
function cl()
{ch.style.color="red";
ch.style.backgroundColor="#ccc"}
//定义"改变宽高"的函数
function hw()
{ch.style.width="200px";
ch.style.heitht="200px";}
var ch=document.getElementById("txt");
function cl()
{ch.style.color="red";
ch.style.backgroundColor="#ccc"}
//定义"改变宽高"的函数
function hw()
{ch.style.width="200px";
ch.style.heitht="200px";}
这个速度,先把前面代码改一下,在写后面的window close(),要不然除非你金手指!
2015-04-28