HTML элемент noscript

HTML элемент noscript — Резервный контент для скрипта
. Все HTML элементы.

HTML элемент noscript: Пример кода

 <h2>Пример 1: создание noscript</h2>
<form action="calcSquare.php">
 <p>
 <label for=x>Число</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>


 <h2>Пример 2: создание noscript</h2>
<form action="calcSquare.php">
 <p>
 <label for=x>Число</label>:
 <input id="x" name="x" type="number">
 </p>
 <input id="submit" type=submit value="Calculate Square">
 <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;
 };
 var submit = document.getElementById('submit');
 submit.parentNode.removeChild(submit);
 </script>
</form>
 

HTML элемент noscript: атрибуты

globals