<!------ 아래의 코드를 HEAD 부분에 복사해 넣으세요 -------------->
<script>
function clearText(y){
if (y.defaultValue==y.value)
y.value = ""
}
</script>
<!------ 아래의 방식으로 BODY 부분에 붙여 넣으세요 ------------->
<B>텍스트 상자에 마우스를 클릭하면 초기문자열이 없어집니다</B>
<form>
<input type="text" value="아이디를 입력 해 주세요" onFocus="clearText(this)">
<input type=submit>
</form>
<script>
function clearText(y){
if (y.defaultValue==y.value)
y.value = ""
}
</script>
<!------ 아래의 방식으로 BODY 부분에 붙여 넣으세요 ------------->
<B>텍스트 상자에 마우스를 클릭하면 초기문자열이 없어집니다</B>
<form>
<input type="text" value="아이디를 입력 해 주세요" onFocus="clearText(this)">
<input type=submit>
</form>
'Web(웹) Study > Java Script' 카테고리의 다른 글
영타를 한글로 ^^ (0) | 2007.12.19 |
---|---|
입력 문자 한글 체크 (0) | 2007.12.19 |
특수 문자 입력 제한 및 가격 천단위 , 표시하기 (0) | 2007.12.05 |
Internet Explorer에서 셀렉트박스와 레이어가 겹칠시 레이어가 셀렉트 박스 뒤로 숨는 현상을 해결하는 함수 (0) | 2007.12.05 |
웹에디터 모듈 제공 업체 (0) | 2007.12.05 |