생활 웹디자인

코스 전체목록

닫기

noscript

정의

noscript요소는 스크립트가 비활성화되었을 때 나타낼 내용을 표시합니다.

설명

  • 스크립트가 활성화 되었을때는 noscript안의 내용은 무시됩니다.

예제

<form action="calcSquare.php">
    <p>
        <label for=x>Number</label>:
        <input id="x" name="x" type="number">
    </p>
    <script>
        var x = document.getElementById('x');
        var output = document.createElement('p');
        output.textContent = 'Type a number; it will be squared right then!';
        x.form.appendChild(output);
        x.form.onsubmit = function () { return false; }
        x.oninput = function () {
        var v = x.valueAsNumber;
        output.textContent = v + ' squared is ' + v * v;
        };
    </script>
    <noscript>
        <input type=submit value="Calculate Square">
    </noscript>
</form>

댓글

오류나 오타 신고 환영합니다. ^^;;
(도와주세요!)

댓글 본문
graphittie 자세히 보기