[완료]JavaScript 관련 질문입니다.
글쓴이: lovethecorners / 작성시간: 금, 2007/05/25 - 6:05오전
특별히 질문할곳이 없어서 여러분들께 질문드립니다.
textarea에 관해서 작동은 되지만, 한가지 첨부할수있으면 하려합니다.
textarea에서 onkeyup을 이용해 글자수와 라인수를 입력과 동시에 확인할수있도록 했습니다. 그런데 라인수의 경우에 적정 라인수를 넘으면 alert을 띄우는것을 대신해서 숫자를 빨간색으로 변경해서 보여주려합니다.
var maxrows = 5; . . . for (i=0;i<arrtxt.length;i++) { rows+=parseInt(arrtxt[i].length/cols); } document.topics.current_line1.value = rows; if(rows > maxrows) { document.topics.current_line1.value = rows; ---> 이부분을 어떻게 하면 font color를 같이 넘길수있을까요? } . . .
<input type="text" name="current_line1" readonly value="0" size="2"> line(s)
카운트 되는 rows가 maxrows를 넘어가면 위의 input에 나오는 숫자의 color를 변경해서 보여주는것이 가능할까요?
Forums:
document.forms['topics']['cur
document.forms['topics']['current_line1'].style.color='red';
아, 감사합니다.
아, 감사합니다.
bold는 적용이 않되는가 봅니다. 그래서
<input .... style="font-weight:bold">
이렇게 처리했습니다.==
more than one way to do it
말로만 블로거: http://gojdweb.egloos.com
document.forms['topics']['cur
document.forms['topics']['current_line1'].style.fontWeight='bold';
아니, 대/소문자
아니, 대/소문자 구별을 하는군요.... 그것도 해보았었는데.
감사합니다. 이런것에 관한 책이나 사이트 아시면 소개좀 해주세요.
==
more than one way to do it
말로만 블로거: http://gojdweb.egloos.com
댓글 달기