GPT答: |
7i24.cn
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Chatgpt机器人</title>
<style>
body {
background-color: #f5f5f5;
margin: 0px;
padding: 0px;
}
#chat {
background-color: #fff;
width: 600px;
margin: 10px auto;
font-size: 16px;
padding: 10px;
overflow:auto;
}
#chat h1 {
font-size: 22px;
font-weight: bold;
padding: 0px;
margin: 5px 0px;
text-align: center;
}
#chat #user_form {
padding-bottom: 5px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
#chat #user_form div {
float: left;
}
#chat #user_form #user_question {
width: 400px;
line-height: 30px;
height: 30px;
font-size: 16px;
}
#chat #user_form #get_question {
width: 120px;
line-height: 30px;
height: 30px;
font-size: 14px;
background: blue;
color: #fff;
text-align: center;
border: none;
margin-right: 10px;
cursor: pointer;
}
#chat #user_form #get_question:hover {
background-color: #2196F3;
}
#chat #answer_form {
padding: 10px 0px;
}
#chat #answer_form #user_answer {
width: 500px;
height: 120px;
font-size: 16px;
border: none;
padding: 10px;
}
</style>
</head>
<body>
<div id="chat">
<h1>Chatgpt机器人</h1>
<div id="user_form">
<div>
<input type="text" id="user_question" name="user_question">
</div>
<div>
<input type="submit" id="get_question" value="提问" onclick="getAnswer()"/>
</div>
<div>
<span id="show_answer"></span>
</div>
</div>
<div id="answer_form">
<textarea name="user_answer" id="user_answer" cols="30" rows="10" disabled></textarea>
</div>
</div>
<script type="text/javascript">
function getAnswer() {
var the_question = document.getElementById("user_question");
var..
|