【发布时间】:2014-05-18 19:22:39
【问题描述】:
我想创建代码来实现它,所以当我在文本框中输入“hello”时,我可以按下下面的按钮,然后会出现一个特定的警报弹出窗口。我还想在不同的单词中添加更多这些。我应该在我的代码中添加什么来完成这项工作?
<!DOCTYPE html>
<html>
<head>
<title>thisThat</title>
<style>
body {
background-color: #333333;
}
.input, .output {
border: 0;
padding: 8px;
font-size: 14px;
}
.output {
background-color: #ff0000;
}
p {
font-size: 18px;
}
</style>
</head>
<body>
<center><h3>thisThat</h3></center>
<center><p>
If
</p></center>
<center><input placeholder="this..." class="input"></center>
<center><p>then</p></center>
<center><button class="output">that...</button></center>
</body>
</html>
【问题讨论】:
-
旁注,不要使用
<center>标签,它在 1950 年左右被弃用。 -
你试过什么?在询问它是如何完成的之前,您至少需要尝试解决您的问题。如果不真正学习如何去做,您将无法建立掌握编码技巧所必需的基础知识。
-
我确实尝试了几次,但我删除了那些。这是来自 stackoverflow 的解决方案,但没有奏效。
标签: javascript css html button input