HTML5 태그 사전

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>

댓글

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

댓글 본문
  1. 푸른하늘
    8
  2. yunye
    짱남님, 재밌는 질문이네요. 근데 답변이 없네요 ㅠㅠ
  3. 짱남
    궁금한것이 있습니다
    사용자가 임의대로 css나 script를 끌방법이 있다고 주워들은것같은데
    그렇다면 그런경우에도 noscript가 작동이되는건지

    아니면 단순히 웹애플리케이션의 문제로 스크립트의 함수라던지 이벤트가 발생하지않았을때에
    noscript가 작동이 되는건지 궁금하네요

    만약에 사용자가 script를 껏을당시에도 noscript가 작동이된다면
    noscript에
    원래의 스크립트를 그대로 복사해넣으면
    스크립트가 작동되지않아도
    noscript가 똑같은 수행을 해주는것인가요?
graphittie 자세히 보기