입력상자에 텍스트 순서를 앞뒤로 바꿉니다 > script

본문 바로가기

script

입력상자에 텍스트 순서를 앞뒤로 바꿉니다

작성일 07-08-11 20:49

페이지 정보

작성자서방님 조회 610회 댓글 0건

본문

<SCRIPT LANGUAGE="JavaScript">
<!--
function reverse(form) {
    text = "";
    str = form.revtext.value;
    for (i = 0; i <= str.length; i++)
        text = str.substring(i, i+1) + text;
        document.aab.revtext.value = text;
}
//-->
</script>

<form name="aab">
<input type="text" name="revtext" value="대한민국 만세">
<input type="button" value="바꾸기" onClick="reverse(this.form)">
</form>

댓글목록

등록된 댓글이 없습니다.

게시물 검색
Copyright © 서방님.kr All rights reserved.
PC 버전으로 보기