【问题标题】:remove text from field after submit提交后从字段中删除文本
【发布时间】:2022-12-23 22:10:49
【问题描述】:

我有一个带有发送按钮的数字框

<input id="inputbox" type="number">
<button id="button" type="button" onclick="sendBid()"> Send </button>

点击按钮后发送信息

<script>
function sendBid() {
        liveSend(parseInt(inputbox.value));
    }
</script>

该数字应从输入框的显示中删除。我怎样才能做到这一点?

【问题讨论】:

  • 你设置值了吗?
  • 不,一开始它是空的。

标签: javascript html button send


【解决方案1】:
<script>
function sendBid() {
        liveSend(parseInt(inputbox.value));
        inputbox.value = ""; // This line
    }
</script>

【讨论】:

    猜你喜欢
    • 2019-04-21
    • 2015-04-17
    • 1970-01-01
    • 2014-10-29
    • 1970-01-01
    • 2011-12-12
    • 2012-04-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多