function submit()
{
if (document.getElementById('szValue').value === "Enter First Value")
{
document.getElementById('szValue').value = "";
}
if (document.getElementById('szPara').value === "Enter Second Value")
{
document.getElementById('szPara').value = "";
}
document.searchForm.submit();
}
答案 0 :(得分:0)
替换
if (document.getElementById('szPara').value === Enter Second Value"){
与
if (document.getElementById('szPara').value === "Enter Second Value"){
<强> 修改 强>
检查字符串的大小写是否与代码示例中的大小写相同。如果您愿意,可以更改案例并在if语句中进行比较,如
var dVal = "Enter Second Value";
if(document.getElementById('szPara').value.toLowerCase() === dVal.toLowerCase())
{
// write your code here
}