我的一个alert弹窗显示
html:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>您好</title>
<script src="Hello.js"></script>
</head>
<body>
<h1>问候</h1>
<p>请输入问候语,<br/>
比如:您(你)好,早(晚)上好...<br/>
或者其他的内容都可以 <br/>
《主要实现了文本的复制》
</p>
<input id="demo" type="text"/>
<button type="button" onclick="myFunction()">点击这里</button>
</body>
</html>
js:
function myFunction(){
var x = document.getElementById("demo").value;
"x" == x;
alert(x);
}
图片: