我在JavaScript中編寫了電話號碼保護程序。一切正常,但是當我搜索一個名稱,或在搜索框中輸入數字正在顯示沒有結果:保存結果未顯示在Javascript中
function contact() {
var nam1=prompt("Please enter the name");
var num1=prompt("please enter the phone number");
}
contact();
function search() {
var searc= prompt("Please enter the name of your contact or phone number");
}
search();
//search box
if (searc == nam1) {
alert("The phone Number is , " + num1);
}
if (searc == num1) {
alert("The Contact Name is , " + nam1);
}
謝謝:)它的工作 – 2013-05-03 05:11:25
@MISJHA複製我的答案? – 2013-05-03 05:20:25
哈哈,一點都不! :)解決方案非常簡單! ;) – MISJHA 2013-05-03 05:22:07