javascript问题又来了。。。

来源:百度知道 编辑:UC知道 时间:2024/06/01 12:32:24
<!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 delete()
{
alert("");
if(document.form1.txtname.value =="请输入电子信箱")
{
document.form1.txtname.value = "";
document.form1.txtname.style.color = "red";
}
}
</script>
</head>

<body>
<form id="form1" name=&q

兄弟 delete是关键字 你把方法名换个名就好了

你应该去看下JS有哪些关键字。

<!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 delete1()
{
alert("");
if(document.form1.txtname.value =="请输入电子信箱")
{
document.form1.txtname.value = "";
document.form1.txtname.style.color = "red";
}
}
</script>
</head>

<body>
<f