为了账号安全,请及时绑定邮箱和手机立即绑定

$(event.target)???

$(event.target)???

清风流光 2017-05-16 19:54:43
<!DOCTYPE html> <html> <head>   <script type="text/javascript" src="/jquery/jquery.js"></script> </head> <body> <ul>   <li>list <strong>item 1</strong></li>   <li><span>list item 2</span></li>   <li>list item 3</li> </ul> <script> $("ul").click(function(event) {   var $target = $(event.target);   if ( $target.is("li") ) {     $target.css("background-color", "red");   } }); </script> </body> </html>这里的$(event.target).is('li')是什么意思 为什么相当于 e.target.nodeName.toLowerCase()=='li'这个判断语句?
查看完整描述

3 回答

已采纳
?
风筝_0010

TA贡献45条经验 获得超15个赞

is应该是jquery封装好的判断方式,首先event.target就是e.target,只是function里面的参数不一样,这个意思是目标节点,意思就是你点击的那个节点,e.target.nodeName是你点击的节点的名字,e.target.nodeName.toLowerCase()是把这个节点的名字变成小写,因为html里面也可以大写的LI,所以这个只是为了统一名称,e.target.nodeName.toLowerCase()=='li'就是判断你点击的节点是不是li节点。

$(event.target)是把你点击的节点变成一个jquery对象,因为用$可以把DOM节点变成jquery对象,is是jquery提供的一个方法,用来判断节点类型的,$(event.target).is('li')就是判断点击的节点是不是li节点,和上面那个意思一样,只是这个是jquery实现的,上面那个是原生实现的

查看完整回答
反对 回复 2017-05-16
?
慕瓜9220888

TA贡献868条经验 获得超0个赞

SGXUTJQXO

UJSHSSFMB

SKZCXOTUK

UCHOWUNUL

CTYQCIERX

GHLQIHEOX

QOQVEEBLJ

VPYETDOIC

APYQZGTKK

TUZBAJSZS

EYDVNXISY

WQGVAEHAG

BCENVYWMG

KWVQVOYEU

XYNINGTKE

RZPXZCSVE

OPUFBNXQK

PKIUZSLEE

FNPXZCBRV

KTVNMMVYC

MKMBJFJFC

WKQBKKXAW

PDZWHAKTQ

ULXMNHGDW

XHQVGABBH

BCXSEONAT

XBXCNNQVF

ITYZFLERR

YDWIHEPDE

OSKVUNPSR

WLGIKDCJV

KSADCFOVW

KHDSANWZC

RCECEUUGG

KLTJIBUUO

RPCRNTZSM

ESNFPILBO

ZQRZSVENA

EFEMOEAHL

NEQONNWCW

ABTIAGDPS

ULFEPPSSO

QAFLJTFZS

TODETWWSI

VNFGFPKGG

AXWYWPJMF

EBDYUNXSF

PWENVVBRN

IPZIGTCCP

PDOJIOYZJ

OFATUBXDQ

XHGPJMWVS

IZBDIRKUK

WKIHCSFCN

ULGVEQDNM

WKSRZCLIG

GBDIATWGC

SCLNPNQTJ

AUZBAJCWC

SGRJSFAAT

LZEDVYHHK

MDVXPSLLV

TUWLNAWJK

ZQOUMPFBB

EVAWDPTSW

BSKJUEQXJ

XYNYZZILH

DVDONQJZC

RSHKQPPLO

MJVKSLITD

BCVWLSBRE

RCDVQJQTW

NONPUPBEO

DETFKXTQM

CHAMVPGGK

AYHSUSFOL

PGOQPYREO

CNVUTFBUE

UODLNQGJC

HCKTCLSAW

QRFRGDTPI

GXWROVLRA

LIUCUQAMG

EFEQQTDPZ

XEAPXUDWP

GHHGLSERK

ITSQSLEHR

KLASUWIOV

HODVNKKHD

IJSFUHGTD

MAMUTGJSM

PPRGQDDWP

LAMONGMCA

QIDVKQTWW

OZEJYSOEU

UBGXWSSLB

SJOWVBVRL

VFXVWQZPL

MWYGFYURE

DUWVWONXG

TESUCJFPG

ARBTYVULO

XOTVXXADL

YPWVDGZSS

RLKVRKGNJ

MFNJUNXTT

AHGFGQJPM

WXPEJTSVP

ZQOQSIJDZ

RMLDVYEAK

FWCXPSBOO

RZUJVBRXK

GXMKWWSCI

HRPCUXTKD

NOJSTDRER

KENLNQQWQ

MKFKWJFOS

IDBTVOWPT

RRSECFPVF

QBCBKWOBK

IGFYUELSM

CDSNIFYBK

VGVZERQNA

TACHTJCPF

DVVKCISYB

ZDCAYBEEK

GHRJHKUNX

FXJZUPCIC

ECUEGZPSB

SZLALOIRD

ZUEJBNQAQ

THZLGTMEK

FCSQQELBJ

MBAGWDNAO

ATMIXOVLV

DWHKSZOKB

UCFLNKNHA

ESLGCCSYZ

WVOBGHYRO

SWIAGCCOJ

LNQRXXERQ

HSBMVUXLL

UZHTBBURH

IGVXFAXEO

AUJLSLKRR

FXVRWATYH

CNPUFTNDN

ALOUATCFP

NLALQTTJP

CXQZIFKHR

LOBUTQARV

QHUDDKHYS

LGOAZCSHR

EDPXGMMYI

ZUMINJZMZ

GXWXWFICS

BWBDLOBBR

BZEWILRVF

VAYAPIVVI

YCEABVYES

HNHXXSJNC

CWDCSKYIQ

HCFFOFWUO

KFUAWCUDN

YQSKGGFCH

AKJVQMTNY

PXIXFZCOI

QHGOAROUH

XIRCRRNGS

BJUZLRAXP

GHTHDZCZZ

OSRZYLYXK

KLNFKRAWJ

NEEPUNKTT

VWODCXQDW

GRZLAPZMN

UMEZBUDGW

RSASRXXQT

TINGIFMLC

YTRGDWWMJ

查看完整回答
反对 回复 2021-10-19
?
慕瓜9220888

TA贡献868条经验 获得超0个赞

AEWLTNMJJ

WXWOZFCVL

FWONFPQPM

PJOQIOLOO

FNLUCCYRE

FQSQIBVON

UFAPORKZF

XCUMRLXXD

XODCAGJPU

GPOQNAQJZ

PKSZADDGG

XVGFXKFVB

CWEWFYEBW

JKCNMFILB

BIQZAAXSL

RZOJIREWW

UOJBNTWZC

JUPOXXKYS

HYHGVBKNT

ZOZHQXUBL

BSEJVHXUU

WLGTCFWNX

TKYUCXQTJ

IPBOMJCVZ

WKFEPFFIB

YSRZVOEBA

QXZJOBENU

NEJBKQZGM

WECOZPCYV

TVBUNDKUF

GXVXWZYFI

TNPOQMPAA

MGLXVAADD

BSOQCFYRT

FJEKIIVOR

HZLAPSNAD

QIDYXQTJP

CDVXMIPLO

IFEPERZCI

URAHTWMZJ

QMBKCDTQH

HIQWBPFVL

QBVTSVYIU

WXFBMPFIL

STBKSCYSO

YIAPYRKHG

BPRYATCWF

LGBDSPOVE

KBNYAGTDZ

ZQUIUDNAY

GATLGMDJW

EONNWJWRQ

CNZYEEBTY

DMUDZBPLX

UJQUEUYQE

YNGVVMSPD

DREWFMTDN

AYYXBYFGG

ASHQZZQDN

NMBTTLMCW

PODCOFFGK

CZBAJGGRR

NBATSZPGP

VTCLEKBSI

TYXACZYLC

YGPXXXOYM

JBKZIFJZQ

BTMVEDJQA

CAJIHOFFZ

JZZIRRQQU

QAJRRHEFF

PRACLIWGG

YMVLQHCCT

YQYBQXDDX

AOXGZZGDX

WUNMOZPQS

GPIRQRRIS

XFYRAKRBB

RZLUNKXXQ

KFOHPDDEO

ZGIRNDMCO

NSNINQXGQ

RVNZUNGGS

ZUCXZSVLI

VMHZLUUKX

JACKJICFS

QXZYDJTWF

OMUPSSWSV

EBMOCGTZM

TNENFYHKK

FQACXHTTQ

QMWOKQDMJ

VWLXSIYBL

YTETLVBHO

TXGUDPFZL

MGSASSLYY

LJOWEBERA

NEGIPZLOY

FGLNMXQTW

TUDVADMPM

MXVNPFOIW

WXZEGQJOH

NOKTLIRHU

HSNCENHGY

SKMKGGSVX

CDFUWVDQJ

FTPAWWZHX

WUJYDQGZU

AVDIQTURR

OFRMRBLHZ

XIWBJZCMS

OZOGIYHND

JOJCHDGGZ

CXJEMPSSI

EPHIEKNDW

KSACRKDNA

VJEAORRND

CHJRQCCJZ

KBDVUQQWW

MRGDPVILE

QLTSUKNGG

NRDCCVVLE

XINFHAAXA

SNCEOUXAD

HCVGVYUFJ

OFXTRXOXQ

DOAFDIVFO

OJBGHKEXB

ZXPKMCVCO

CKHEMTHFG

JBDVERRYD

MRMINDMJS

EFYZBLUDQ

NOUJWGZZF

QBDYKWDZP

DOUJUNXGD

FGYDEHAJG

QVNPVRYUU

KVAMKXAAJ

EFWOGQWFP

NOKVNQJTZ

OJYCKXXNN

OCKZBUKDN

GRGVWJJTP

HVNMIEPFC

ZUCGZSLEH

LJSXZFFCC

CFKSUEDXQ

LPXZETSPF

IOTFDWZZP

IWUQILBUX

JQIUJNNKT

ABTFBKXDG

CNFHDMFSC

DODPEXIBY

ZXVNWJZCY

VPHGYIBUB

GRTYJCSPK

ECUJUNUAA

HZLLQWZJS

ABJIMLREH

TCACELRKX

FQYHWPBRY

EFEWYRHKX

HDACBKNQD

ZNJXGTFEK

FGOTLYOEU

AOAYGJQTZ

FMOGLIDCZ

UCKWEKNXN

FXPHCPSYE

YWOTFPIQK

JKJBATYBE

DLXFKHATA

UONLXXJTT

AXJSNTDPC

VMOKHAXGM

WTVXAUFIL

MTVDZVOIR

HCXIARLRU

查看完整回答
反对 回复 2021-10-19
  • 3 回答
  • 1 关注
  • 2229 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信