第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

提交表單時(shí)鍵盤消失

提交表單時(shí)鍵盤消失

犯罪嫌疑人X 2021-06-09 17:14:02
我正在制作實(shí)時(shí)聊天應(yīng)用程序,當(dāng)用戶在輸入中鍵入內(nèi)容并提交表單(單擊發(fā)送按鈕)時(shí),鍵盤(移動(dòng)設(shè)備上的虛擬鍵盤)消失。我想保持鍵盤打開。<form class="panel" action="">  <input type="text" class="message" id="message" autocomplete="off" spellcheck="false">  <img src="upl.png" class="upload_img"/>  <button type="submit" class="send" id="send"></button></form>
查看完整描述

3 回答

?
慕運(yùn)維8079593

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超5個(gè)贊

let form = document.getElementById("form");

let input = form.children["input"];

let send = form.children["send"];


form.addEventListener("submit", (e) =>

{

    // Use Ajax to send the message to php page.

    if (input.value.length !== 0)

    {

        console.log(input.value);

    }


    // Reset the input:

    input.value = "";


    // Disable the submit:

    e.preventDefault();

});


send.addEventListener("focus", (e) =>

{

    input.focus();

});

<form class="panel" id="form">

  <input name="input" type="text" class="message" autocomplete="off" spellcheck="false"/>

  <button name="send" class="send">S</button>

</form>


查看完整回答
反對(duì) 回復(fù) 2021-06-11
  • 3 回答
  • 0 關(guān)注
  • 153 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)