Video: Tus cwj pwm xaiv jQuery yog dab tsi?
2024 Tus sau: Lynn Donovan | [email protected]. Kawg hloov kho: 2023-12-15 23:47
Cov [ tus cwj pwm ] Xaiv yog inbuilt xaiv hauv jQuery , siv los xaiv tag nrho cov ntsiab lus nrog cov teev tus cwj pwm . Syntax: $("[attribute_name]") Parameter: attribute_name: Nws yog qhov yuav tsum tau muaj parameter uas qhia txog qhov tus cwj pwm los xaiv.
Tsis tas li ntawd, tus selector hauv jQuery yog dab tsi?
A jQuery xaiv yog ib txoj haujlwm uas ua rau siv cov lus qhia kom paub qhov sib xws cov ntsiab lus los ntawm DOM raws li cov txheej txheem muab. Tsuas yog koj tuaj yeem hais, xaiv yog siv los xaiv ib lossis ntau HTML cov ntsiab lus siv jQuery . Thaum ib lub caij raug xaiv ces peb tuaj yeem ua ntau yam haujlwm ntawm cov khoom xaiv ntawd.
Ib yam li ntawd, cov selectors hauv JavaScript yog dab tsi? JS siv CSS syntax los xaiv thiab tswj hwm cov ntsiab lus HTML. Cov xaiv yog siv los "nrhiav" (xaiv) cov ntsiab lus HTML raws li lawv lub npe tag, ID, chav kawm, hom, yam ntxwv, qhov tseem ceeb ntawm tus cwj pwm thiab ntau ntxiv. Ib daim ntawv teev tag nrho xaiv tuaj yeem pom hauv peb CSS Xaiv Kev siv.
Ib yam li ntawd, dab tsi yog qhov yooj yim xaiv hauv jQuery?
jQuery Selectors
Xaiv | Piv txwv | Xaiv |
---|---|---|
[attribute*=value] | $([title*='nyob zoo']") | Tag nrho cov ntsiab lus nrog tus nqi npe tus nqi uas muaj lo lus "nyob zoo" |
: input | $(":input") | Tag nrho cov ntsiab lus nkag |
: ntawv | $(":text") | Tag nrho cov input ntsiab nrog |
:password | $(":password") | Tag nrho cov input ntsiab nrog |
Tus neeg xaiv hauv qab no ua dab tsi $(Div?
Cov nram qab no selector : $( " div ua ") tsuas yog xaiv thawj div ua element nyob rau hauv cov ntaub ntawv HTML. Cov nram qab no selector : $( " div ua ") xaiv tsuas yog thawj div ua element nyob rau hauv cov ntaub ntawv HTML.
Pom zoo:
Dab tsi yog tus cwj pwm teeb tsa BBC Bitesize?
Cov cim. Computers ua haujlwm hauv binary. Raws li qhov tshwm sim, txhua tus cim, txawm tias lawv yog cov tsiaj ntawv, cim cim lossis tus lej raug khaws cia ua tus lej binary. Tag nrho cov cim uas lub computer siv tau yog hu ua cov cim
Dab tsi yog txoj hlua khiav rau tus cwj pwm '<'?
XML dim cov cim Cov cim tshwj xeeb khiav tawm daim ntawv tau hloov los ntawm Ampersand && Tsawg tshaj < Quotes " '
Dab tsi yog qhov txawv ntawm daim teb thiab tus cwj pwm?
Field A tus tswv cuab ntawm cov chav kawm. AttributeAn attribute yog lwm lub sij hawm rau ib daim teb. Nws feem ntau yog thaj chaw pej xeem uas tuaj yeem nkag mus ncaj qha. Cia peb pom ib qho xwm txheej tshwj xeeb ntawm Array, qhov array yog qhov tsis txaus ntseeg thiab koj tau nkag mus rau pej xeem tus nqi tas li uas sawv cev qhov ntev ntawm cov array
Dab tsi yog tus cwj pwm tswj cov kab kos?
Cov kab kos yog cov kab ntawv tswj tshwj xeeb uas tsim los rau cov ntaub ntawv tus cwj pwm (piv txwv li suav cov ntaub ntawv). Cov kab kos duab saib xyuas cov txheej txheem qhov chaw thiab kev hloov pauv raws sijhawm hauv ib daim ntawv qhia
Cov cim dab tsi tuaj yeem siv los hloov cov khoom siv hluav taws xob ntawm tus cwj pwm hauv tus xaiv?
1. Asterisk (*): Nws yog siv los hloov 1 lossis ntau tus cim los ntawm tus cwj pwm xaiv. Rau Ej. yog tus cwj pwm uas hloov dynamically, txhua zaus koj qhib ib lub vev xaib tshwj xeeb