[JQuery]input안에 글씨넣기[JQuery]input안에 글씨넣기

Posted at 2014. 1. 8. 00:57 | Posted in IT/JS/jQuery
홈페이제작업체 NuGuWeb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$(function(){
 $('input[type=text]').focus(function() {
       if($(this).val() == $(this).attr('defaultValue')) {
          $(this).val('');
       }
    })
    .blur(function() {
       if($(this).val().length == 0) {
          $(this).val($(this).attr('defaultValue'));
       }
    });
 }); 
<input type="submit" value="로그인" tabindex="3">  
글을적으려고 클릭을하게되면 로그인이라는 글자가 사라진다 ㅡ .ㅡ
하지만 아직 꼼수를 이용한 방법같다 
왜냐면 password는 *******나타 나기때문에 ㅡ. ㅡ 다른방법을 강구해봐야겠다  
//