စကားဝှက် ရွေးချယ်သူ
ရွေးချယ်သူ :password သည်
password အမျိုးအစားရှိ အစိတ်အပိုင်းများကို
ရွေးချယ်ပါသည်။
စကားဝှက်ထည့်ရန် အကွက်များကို
ကြည့်ပါ။
$(':password') ၏ တန်းတူညီမျှမှုမှာ
$('[type=password]') ဖြစ်သည်။
:password သည် CSS သတ်မှတ်ချက်တွင် မပါဝင်သောကြောင့်၊
ယခုခေတ် ဘရောက်ဆာများတွင် စွမ်းဆောင်ရည်ကို မြှင့်တင်ရန်
အစား [type='password'] ကို အသုံးပြုသင့်သည်။
ဝါကျဖွဲ့စည်းပုံ
password အမျိုးအစားရှိ အကွက်များကို ဤသို့ရွေးချယ်ပါသည်။
$(':password');
အခြား စာကြောင်းအတု-အတန်းအစား ရွေးချယ်သူများကဲ့သို့ပင်
(':' ဖြင့် စသော)၊ ':' မတိုင်မီ
တဂ်အမည် သို့မဟုတ် အခြားရွေးချယ်သူတစ်ခုခုကို ထားသင့်သည်၊
သို့မဟုတ်ပါက '*' ရွေးချယ်သူကို အသုံးပြုမည်ဖြစ်သည်၊
ဆိုလိုသည်မှာ $(':password') ကို
$('*:password') အဖြစ် နားလည်မည်ဖြစ်သည်၊ ထို့ကြောင့်
$('input:password') ကို အသုံးပြုသင့်သည်။
ဥပမာ
password အမျိုးအစားရှိ input အားလုံးကို ရွေးချယ်ကာ
css နည်းလမ်းကို အသုံးပြု၍
အစိမ်းရောင် နောက်ခံနှင့် အနီရောင် ဘောင်ကို ထည့်ကြပါစို့။
<form>
<input type="button" value="button">
<input type="file">
<input type="password">
<button>button</button>
<input type="reset">
<input type="radio" name="test">
<input type="radio" name="test">
<input type="checkbox">
<input type="text">
</form>
<+javascript+>
$('form input:password').css({background: 'green', border: '2px red solid'});
$('form').submit(function(event) {
event.preventDefault(); // ပုံစံပို့ခြင်းကို တားဆီးပေးသည်
});
<-javascript->