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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

$(this).val(e.data)中的data如何解釋???

<!DOCTYPE html>

<html>


<head>

? ? <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

? ? <title></title>

? ? <style>

? ? .left div,

? ? .right div {

? ? ? ? width: 500px;

? ? ? ? height: 50px;

? ? ? ? padding: 5px;

? ? ? ? margin: 5px;

? ? ? ? float: left;

? ? ? ? border: 1px solid #ccc;

? ? }

? ? .left div {

? ? ? ? background: #bbffaa;

? ? }

? ??

? ? .right div {

? ? ? ? background: yellow;

? ? }

? ? </style>

? ? <script src="http://idcbgp.cn/static/lib/jquery/1.9.1/jquery.js"></script>

</head>


<body>

? ? <h2>.focusin()方法</h2>

? ? <div class="left">

? ? ? ? <div class="aaron">

? ? ? ? ? ? 點(diǎn)擊聚焦:<input type="text" />

? ? ? ? </div>

? ? </div>

? ? <div class="right">

? ? ? ? <div class="aaron1">

? ? ? ? ? ? 點(diǎn)擊聚焦并傳遞參數(shù):<input type="text" />

? ? ? ? </div>

? ? </div>


? ? <script type="text/javascript">

? ? ? ? //input聚焦

? ? ? ? //給input元素增加一個(gè)邊框

? ? ? ? $("input:first").focusin(function() {

? ? ? ? ? ? ?$(this).css('border','2px solid red')

? ? ? ? })

? ? </script>

? ? <script type="text/javascript">


? ? ? ? //不同函數(shù)傳遞數(shù)據(jù)

? ? ? ? ? ? $("input:last").focusin('慕課網(wǎng)', function fn(e) {

? ? ? ? ? ? ?$(this).val(e.data)

? ? ? ? ? ? });


? ? </script>

</body>


</html>


正在回答

2 回答

$("input:last").focusin('慕課網(wǎng)', function fn(e) {

? ? ? ? ? ? ?$(this).val(e.data)

? ? ? ? ? ? });

首先,因?yàn)?("ele").focusin('data','fn'),點(diǎn)擊文本框觸發(fā)焦點(diǎn)事件,'data'傳入了數(shù)據(jù):“慕課網(wǎng)”儲(chǔ)存在focusin件事里面(也就是這里的e),后面的e.data就是讀取你傳入的數(shù)據(jù):“慕課網(wǎng)”這3個(gè)中文。val()你應(yīng)該理解吧,就是把data數(shù)據(jù)輸入到input文本框里。也就是為什么你點(diǎn)擊文本框的時(shí)候會(huì)出現(xiàn)“慕課網(wǎng)”的原因了。


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

web_東 提問(wèn)者

valu()是給文本框設(shè)置valu值。
2018-03-21 回復(fù) 有任何疑惑可以回復(fù)我~
#2

web_東 提問(wèn)者

event.data就是讀取保存在event里的數(shù)據(jù),是這樣理解?
2018-03-21 回復(fù) 有任何疑惑可以回復(fù)我~
#3

阿阿阿布 回復(fù) web_東 提問(wèn)者

對(duì)的,我是這么理解的!
2018-03-21 回復(fù) 有任何疑惑可以回復(fù)我~
#4

web_東 提問(wèn)者

非常感謝!
2018-03-22 回復(fù) 有任何疑惑可以回復(fù)我~
查看1條回復(fù)

e是focusin對(duì)象,我們?cè)谟胒ocusion函數(shù)的時(shí)候傳入了data的值是慕課網(wǎng),所以e.data就是慕課網(wǎng)

1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

web_東 提問(wèn)者

data
2018-03-21 回復(fù) 有任何疑惑可以回復(fù)我~
#2

web_東 提問(wèn)者

data是focusin函數(shù)的參數(shù)?
2018-03-21 回復(fù) 有任何疑惑可以回復(fù)我~
#3

web_東 提問(wèn)者

W3C沒(méi)有提到這個(gè)
2018-03-21 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

$(this).val(e.data)中的data如何解釋???

我要回答 關(guān)注問(wèn)題
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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