我真的不知道爲什麼這兩個函數 - leave()& do() - 不要運行!爲什麼這兩個功能不想運行?
function leave()
{
var x = document.getElementById("x");
if(x.value == "")
{
alert("please enter your name");
x.focus();
}
}
function do()
{
var y = document.getElementById("y");
if (y.value = "enter your name here")
{
alert("enter your last name");
y.focus();
y.select();
}
}
這裏是我的代碼:http://jsfiddle.net/BsHa2
在此先感謝
郵政編碼**在問題本身**,不要只是鏈接。這是**爲什麼**系統阻止您發佈jsfiddle鏈接,直到您將其標記爲代碼。當然,圍繞這樣的系統工作並不是你最好的選擇? –
[jsFiddle:html和js之間沒有連接?無法從按鈕調用簡單的函數?](http://stackoverflow.com/questions/14499783/jsfiddle-no-connection-between-html-and-js-cant-call-simple-function-from-but) – Sirko
TJ Crowder,對不起,我不知道! 但我不能再問任何問題嗎? –