我怎样才能让用户在确认信上写点什么
例。 我正在尝试发出警告,提示“您确定要删除此名称吗?”
然后用户需要写
“确定”或“好的”
这就是我现在使用的。
<a href="deleteCourse.php">"onclick="return confirm('Are you sure you want to delete this name?');" class="deleteColor">Delete</a>
最佳答案
我想你想使用提示:
http://www.w3schools.com/jsref/met_win_prompt.asp
也许可以这样写:
function confirmDelete() {
var response = prompt("Please type [DELETE] to confirm you want to delete this entry", "Confirm Delete");
if (response=='DELETE') {
return true;
}
}
关于javascript - 返回确认写入 "ok",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23796253/