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

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

如何確定一個按鈕關閉哪一個警告框呢??用JS來觸發(fā)的話

如何確定一個按鈕關閉哪一個警告框呢??用JS來觸發(fā)的話,給按鈕綁定了事件,卻沒有綁定哪一個警告框。。。。

正在回答

3 回答

<div?class="alert?alert-warning"?role="alert"?id="myAlert">
????<h4>謹防被騙</h4>
????<p>請確認您轉賬的信息是你的親朋好友,不要輕意相信不認識的人...</p>
????<button?type="button"??class="btnbtn-danger"?id="close">關閉</button>
</div>
<div?class="alert?alert-warning"?role="alert"?id="myAlert1">
????<h4>謹防被騙</h4>
????<p>1請確認您轉賬的信息是你的親朋好友,不要輕意相信不認識的人...</p>
????<button?type="button"??class="btnbtn-danger"?id="close1">關閉</button>
</div>
??<script?src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
??<script?src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
??<script>
?????$(function(){
????????????$("#close").on("click",function(){
????????????????$(this).alert("close");
????????????});
????????????$("#close1").on("click",function(){
????????????????$(this).alert("close");
????????????});
??????????});
??</script>
0 回復 有任何疑惑可以回復我~
#1

null__ 提問者

非常感謝!
2016-06-01 回復 有任何疑惑可以回復我~

并沒有用。。。

<body>

<div class="alert alert-warning" role="alert" id="myAlert1">

? ? <h4>謹防被騙</h4>

? ? <p>請...</p>

? ? <button type="button" ?class="btn btn-danger" id="close1">關閉</button>

</div>

? ? <div class="alert alert-warning" role="alert" id="myAlert2">

? ? <h4>謹防被騙</h4>

? ? <p>請...</p>

? ? <button type="button" ?class="btn btn-danger" id="close2">關閉</button>

</div> ?

? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>

? <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

? <script>

? ? $(function(){

? ? ? ? $("#close1").on("click",function(){

? ? ? ? ? ? $(this).alert("close"); ?

? ? ? ? }); ? ? ??

? ? ? ? $("#close2").on("click",function(){

? ? ? ? ? ? $(this).alert("close"); ?

? ? ? ? });?

});

? </script>

點擊兩個按鈕都是關閉第二個警告框。。。


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

陳微語

這樣寫是對的,你把兩個警告框的內容弄成不一樣的先吧
2016-04-25 回復 有任何疑惑可以回復我~
#2

西風瀟瀟

有用的,因為你的2個警告框內容是一模一樣的,所以點擊的時候會造成視覺上的錯覺,認為關閉的是同一個按鈕,其實關閉的是不同的。 隨便修改下某一個警告框的內容,就可以發(fā)現(xiàn)。
2016-06-11 回復 有任何疑惑可以回復我~
#3

null__ 提問者 回復 西風瀟瀟

666,是的,謝謝了!
2016-06-13 回復 有任何疑惑可以回復我~

在警告框中加入關閉按鈕

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

null__ 提問者

不知道為啥回復不了你,不過我寫在了問題下面。。。
2016-02-14 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

如何確定一個按鈕關閉哪一個警告框呢??用JS來觸發(fā)的話

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號