大家帮我看看这个问题 不可能吧你把onUnload换成onbeforeunload呢2者区别 一个是关闭前执行 一个关闭时执行 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不知道是什么问题,我刚写的这个获取焦点的也不行,鼠标放在输入框上的时候不会清除“请输入信息”这句话,但是show()却可以执行,这个是怎么回事啊?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script language="javascript">function clear() { document.hello1.hi.value="";}function show() { window.alert("你输入的值是: " + document.hello1.hi.value);}</script></head><body><form name="hello1"><input type="text" name="hi" value="请输入信息" onfocus="clear()" onblur="show()" /></form></body></html> 我用IE,和傲游测试都可以啊,你有的什么浏览器?FF? 更改方法的名字clear为其他的就可以了。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档 </title> <script language="javascript"> function clearText() { document.hello1.hi.value=""; } function show() { window.alert("你输入的值是: " + document.hello1.hi.value); } </script> </head> <body> <form name="hello1"> <input type="text" name="hi" value="请输入信息" onfocus="clearText()" onblur="show()" /> </form> </body> </html> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 变更为<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />这样试试。如果OK的话,说明和你的系统环境,保存文件的字符集设定有关系。如果字符集不正确的话,在解析文件的时候会产生错误,从而导致javascript角本失效。 两个层实现自右向左间的切换 鼠标移动到一张图后 马上出现另一张图片 求正则表达式,超简单 简单问题, javascript运行出错,为什么 急:求助:如何让select灰掉? 好久没来了,孟子老兄哪去了? 高分求解,高手帮忙! value 上面有值,用 javascript 怎样清空? IE6中控制无边窗口大小的问题。 在关闭一个窗口时,同时要把从该窗口打开的所有子窗口都关闭,如何实现? 急,有没有什么网页播放器能把视频文件自动转成flash在播放 addInstanceRow 问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function clear() {
document.hello1.hi.value="";
}
function show() {
window.alert("你输入的值是: " + document.hello1.hi.value);
}
</script>
</head><body>
<form name="hello1">
<input type="text" name="hi" value="请输入信息" onfocus="clear()" onblur="show()" />
</form>
</body>
</html>
我用IE,和傲游测试都可以啊,你有的什么浏览器?FF?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
<script language="javascript">
function clearText() {
document.hello1.hi.value="";
}
function show() {
window.alert("你输入的值是: " + document.hello1.hi.value);
}
</script>
</head> <body>
<form name="hello1">
<input type="text" name="hi" value="请输入信息" onfocus="clearText()" onblur="show()" />
</form>
</body>
</html>
变更为
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
这样试试。
如果OK的话,说明和你的系统环境,
保存文件的字符集设定有关系。
如果字符集不正确的话,
在解析文件的时候会产生错误,
从而导致javascript角本失效。