InterviewHubPRO
Section Overview
Q188

Question 188 of 521

Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

36%
JavaScript Internals (521 Qs)•Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

How do you detect if javascript is disabled on the page

You can use the <noscript> tag to detect whether JavaScript is disabled or not. The code block inside <noscript> gets executed when JavaScript is disabled, and is typically used to display alternative content when the page is generated in JavaScript.

javascript
  <script type="javascript">
      // JS related code goes here
  </script>
  <noscript>
      <a href="next_page.html?noJS=true">JavaScript is disabled in the page. Please click Next Page</a>
  </noscript>