<body>
  <script src='js/Cg.js'></script>
  <div class='basic-portfolio-area ptb-10'>
    <div class='filter-menu text-center'>
<pre><code>&lt;/div&gt;
&lt;div class='call-to-action-area gray-bg ptb-60'&gt;
  &lt;div class='container'&gt;
    &lt;div class='form-group'&gt;
      &lt;label&gt;&lt;/label&gt;
      &lt;textarea class='form-control' id='chat-gpt-input' placeholder='输入问题' rows='3' resize='none' style='width: 100%; margin: 0 auto; background-color: #f4f4f4; color: #333; border: 1px solid #ccc; border-radius: 12px;'&gt;&lt;/textarea&gt;
    &lt;/div&gt;
    &lt;div class='call-to-action'&gt;
      &lt;a onclick='callCHATGPT()' class='btn btn-large' href='#' id='call-to-action-btn' style='background-color: #4cae4c; color: #fff; font-weight: bold; border-radius: 5px; padding: 10px 20px; border: none; box-shadow: none; text-decoration:none;' onmousedown='this.style.backgroundColor='#3c903c'' onmouseup='this.style.backgroundColor='#4cae4c''&gt;回答&lt;/a&gt;
      &lt;a onclick='clearTextArea()' class='btn btn-large' href='#' style='background-color: #d9534f; color: #fff; font-weight: bold; border-radius: 5px; padding: 10px 20px; border: none; box-shadow: none; text-decoration:none; margin-left: 20px;' onmousedown='this.style.backgroundColor='#c9302c'' onmouseup='this.style.backgroundColor='#d9534f''&gt;清空&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class='form-group'&gt;
      &lt;label&gt;&lt;/label&gt;
      &lt;textarea class='form-control' id='chatgpt-response' placeholder='长途访问,请耐心等待回答 Ai生成它很快,但是由于网络问题我们需要等待,通常内容越长等待越久 如果长时间没反应请刷新页面重试' rows='26' resize='none' style='width: 100%;height: auto; margin: 0 auto; background-color: #f4f4f4; color: #333; border: 1px solid #ccc; border-radius: 10px; overflow: scroll;'&gt;&lt;/textarea&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;footer&gt;
    &lt;div class='basic-footer gray-bg text-center ptb-20'&gt;
      &lt;div class='container'&gt;
        &lt;div class='footer-menu mt-30'&gt;
          &lt;p&gt;&lt;a href='untitled.html'&gt;如果不懂怎么发布命令请进入&lt;/a&gt;&lt;/p&gt;
          &lt;nav&gt;
            &lt;ul&gt;
              &lt;li&gt;&lt;a href='https://wy2023.icu' target='_blank'&gt;云客商城&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href='https://ai.wy2023.icu/ai-1' target='_blank'&gt;返回AI-1&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href='https://ai.wy2023.icu' target='_blank'&gt;返回首页&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/nav&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/footer&gt;
&lt;script&gt;
function clearTextArea() {
  document.getElementById('chat-gpt-input').value = '';
  document.getElementById('chatgpt-response').value = '';
  document.getElementById('call-to-action-btn').disabled = false;  //添加这一行代码使回答按钮重新可用
} 
    // 添加以下代码,为回答按钮添加点击事件,每次点击时判断输入框是否为空,如果为空则禁用回答按钮
    document.getElementById('call-to-action-btn').addEventListener('click', function() {
        if (document.getElementById('chat-gpt-input').value.trim() === '') {
            document.getElementById('call-to-action-btn').disabled = true;
        }
    });
&lt;/script&gt;
</code></pre>
  </body>
ChatGPT 问答工具 - 免费使用 AI 智能助手

原文地址: https://www.cveoy.top/t/topic/mmXl 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录