Onblur thiab Onfocus HTML yog dab tsi?
Onblur thiab Onfocus HTML yog dab tsi?

Video: Onblur thiab Onfocus HTML yog dab tsi?

Video: Onblur thiab Onfocus HTML yog dab tsi?
Video: Qhia website bootstrap4 navbar part19 2024, Kaum ib hlis
Anonim

Txhais thiab siv

Cov onblur attribute fires lub caij uas lub caij poob tsom . Onblur feem ntau yog siv nrog daim ntawv validation code (piv txwv li thaum tus neeg siv tawm hauv daim ntawv teb). Tswv yim: The onblur attribute yog qhov opposite ntawm lub tsom xam tus cwj pwm.

Tsuas yog li ntawd, Onfocus yog dab tsi hauv HTML?

tsom xam . Lub hom phiaj ntawm cov HTML tsom attrwibute yog qhia tus neeg siv tus neeg sawv cev uas lub ntsiab tau txais kev tsom xam. Thaum lub ntsiab tau ua kom pom tseeb, yog tias tsom xam yog siv, ib tsab ntawv yog executed. Txhawb cov ntsiab lus. HTML tsom attribute txhawb ib, cheeb tsam, khawm, tswv yim, daim ntawv lo, xaiv, textarea ntsiab.

Kuv yuav siv Onfocus li cas? Lus txhais thiab Kev siv Cov tsom xam kev tshwm sim tshwm sim thaum lub caij tau txais tsom . Cov tsom xam kev tshwm sim feem ntau yog siv nrog,, thiab. Tswv yim: The tsom xam kev tshwm sim yog qhov opposite ntawm qhov kev tshwm sim onblur. Tswv yim: The tsom xam qhov xwm txheej zoo ib yam li cov xwm txheej onfocusin.

Kuj nug, qhov txawv ntawm Onblur thiab Onfocus yog dab tsi?

OnFocus yog thaum koj muab ib yam khoom tsom, los ntawm txhaj rau nws, tabbing rau hauv nws, siv lub tab key, los yog ua txhua yam uas ua rau nws lub active caij. OnBlur yog thaum ib yam dab tsi poob tsom, los ntawm txhaj rau lwm yam, tabbing tawm ntawm nws, siv lub tab key, los yog ua ib yam dab tsi uas ua rau lwm yam lub active caij..

Dab tsi yog qhov kev siv qhov muag plooj?

Cov qhov muag plooj () yog ib txoj kev inbuilt yog jQuery uas yog siv los tshem tawm kev tsom xam los ntawm cov khoom xaiv. Txoj kev no pib lub qhov muag plooj los yog nws tuaj yeem txuas tau a muaj nuj nqi khiav thaum a qhov muag plooj tshwm sim.

Pom zoo: