<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="Jquery/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
alert($(":text").val());
});
});
</script>
</head>
<body>
<p>值: <input type="text" name="user" value="" /></p>
<button>显示文本域的值</button>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
var i,a,b,c;
for (i=100;i<1000;i++){
a=parseInt(i/100);
b=parseInt((i-a*100)/10);
c=parseInt(i-a*100-b*10);
if (a*a*a+b*b*b+c*c*c==i){
document.write(i+",");
}
}
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
function alerInfo(msg) {
alert(msg);
}
function calculate(x, c, y) {
if ('+'==c) {
return x + y;
}
if ('-'==c) {
return x-y;
}
if ('*'==c) {
return x*y;
}
if ('/'==c) {
return x/y;
}
}
alerInfo(calculate(1,'+',100));
</script>
</body>
</html>