亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

點擊按鈕 input獲取焦點.!??!

怎么給一個按鈕添加點擊事件后,讓他旁邊的input標簽獲得焦點?

還有鼠標點擊其他的地方的時候,input的樣式還原?

5786759e0001675202850116.jpg

5786759e0001f47803050109.jpg

5786759e00016e3405000174.jpg

5786759f0001ad8a03900093.jpg


正在回答

2 回答

<input type="text" id="name"/>

<input type="button" value="輸入" onclick="document.getElementById('name').focus();"/>

0 回復 有任何疑惑可以回復我~
#1

忠勝大哥 提問者

非常感謝!
2016-07-14 回復 有任何疑惑可以回復我~
兩個事件???你點button給type=“text”焦點??type="text"的再給個失去焦點事件
<script?type="text/javascript">
????function?textfocus(){
????????document.getElementById("cli").focus()
????????document.getElementById("cli").style.border="1px?solid?red"
??}
??function?xxx(e){
??????e.style.border="1px?solid?gray"
??}
?</script>
?

<input?type="text"?id="cli"?onblur="xxx(this)"/>
<input?type="button"?value="serch"?onclick="textfocus()"/>


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

點擊按鈕 input獲取焦點.?。。?/h1> 我要回答 關注問題

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號