*<html>
<head>
<title>practise</title>
<script type="text/javascript">
function confirm() {
var r = confirm("Press the button");
if (r == true) {
alert("You are right");
} else {
alert("You are wrong");
}
}
</script>
</head>
<body>
<input type="button" name="submit" value="showtime" onclick="confirm()"/>
</div>
</body>
</html>*
Run Code Online (Sandbox Code Playgroud)
我想知道问题是什么.它不起作用,但它与http://www.w3schools.com/js/js_popup.asp中的相同
//just copied this code from w3schools
var person={fname:"John",lname:"Doe",age:25};
for (x in person)
{
document.write(person[x] + " ");
}
Run Code Online (Sandbox Code Playgroud)
我想知道,我必须假设而不是"x".