Để chuyển hướng nếu JavaScript bị tắt, thêm script vào thẻ <noscript>. Giả sử cần chuyển đến index.php nếu JS tắt.
Ví dụ
Cách làm:
<!DOCTYPE html> <html> <head> <title>Thẻ HTML noscript</title> </head> <body> <script> <!-- document.write("Hello JavaScript!") --> </script> <noscript> <style>html{display:none;}</style> <meta http-equiv="refresh" content="0.0;url=nojs/index.php”> </body> </html>Trên dùng CSS ẩn trang trước, vì không muốn trang hiện nếu JS tắt.