>  기사  >  웹 프론트엔드  >  비밀번호 상자에 프롬프트 텍스트가 표시됩니다. jquery example_jquery

비밀번호 상자에 프롬프트 텍스트가 표시됩니다. jquery example_jquery

WBOY
WBOY원래의
2016-05-16 17:23:53933검색
复代码 代码如下:


<머리>
登录

<스크립트>
$(document).ready(function(){
$(".text_login").focus(function(){
if($(this).val()=='사용자 이름' || $(this).val()=='password'){
$(this).val('')
}
if($(this).attr('id' )=='password1'){
$(this).hide();
$('#password2').show()
$('#password2').focus();
}
})
$(".text_login").blur(function(){
if($(this).attr('id')=='password2' && $ (this).val()==''){
$(this).hide()
$('#password1').show()
$('#password1'); .val('password');
}
else if($(this).attr('id')=='uname' && $(this).val()=='' ){
$(this).val('사용자 이름');
}
})
});



<본문>












성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.