 |
|
|  |
|
 |
16년 전 |
여기서 중요한 것은 인풋박스에 백그라운드 이미지를 우선 적으로 스타일로 정의를 합니다.
1. style="width:260; height:18; background-image: url(test_img.gif); background-repeat: no-repeat;"
두번재로 해당 인풋에 마우스가 클릭됐을때 스크립트를 사용하여 백그라운드 이미지를 지워주는 부분을 정의합니다.
2. onfocus="if(this.value=='') this.style.backgroundImage='';"
세번째로 마우스가 다른곳을 클릭했을때 백그라운드 이미지를 다시 넣어주는 스크립트를 정의합니다.
3. onblur="if(this.value=='') this.style.backgroundImage='url(test_img.gif)';"
아래 소스는 모든 내용을 포함한 예시 입니다.
<input name="test" type="text" style="width:260; height:18; background-image: url(test_img.gif); background-repeat: no-repeat;" onfocus="if(this.value=='') this.style.backgroundImage='';" onblur="if(this.value=='') this.style.backgroundImage='url(/join/img/login_input_pass.gif)';" /> |
|
추천 : 482 |
추천
목록
|
|
|  |
|