<input type="text" id="changeUpper" />
<input type="button" value="check" id="changebtn" />
<script>
var Btn = document.querySelector("#changebtn");
Btn.onclick = function () {
var text = document.querySelector("#changeUpper").value;
text = text.replace(/(\s*)/g, "");
text = text.toUpperCase();
document.querySelector("#changeUpper").value = text;
};
</script>
'컴퓨터 > javascript' 카테고리의 다른 글
call, apply, bind 함수의 차이 (0) | 2022.01.15 |
---|---|
자바스크립트로 달력 그리기 (0) | 2017.11.30 |
jquery span 안의 문자열 접근하여 비교 (0) | 2017.09.19 |
자바스크립트 정렬해주는 사이트 (0) | 2017.08.18 |
댓글