求一句网页代码,谢谢

来源:百度知道 编辑:UC知道 时间:2024/06/23 17:14:57
比如在当前窗口,我想鼠标点击[关闭当前窗口]字样时,就自动关闭当前窗口,这种代码应该怎么写,谢谢!

<!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>
</head>

<body>
////////////
这个按钮就是关闭当前页面用onclick事件触发(onclick="javascript:window.close();")
////////////
<input type="submit" name="Submit" value="关闭" onclick="javascript:window.close();"/>
</body>
</html>