有问题......谁能告诉我我在这段 JavaScript 代码上做错了什么:
function getname() {
var the_name = window.prompt("Enter your first name", "");
var first_char = the_name.charAt(0);
if(first_char = "S") then {
document.write(the_name);
} else {
window.alert("Please enter a name that starts with an uppercase S to have it displayed.");
}
}