A

Admin • 831.35K Points
Coach

Q. JavaScript can be written

  • (A) directly into JS file and included into HTML
  • (B) directly on the server page
  • (C) directly into HTML pages
  • (D) all of the mentioned
  • Correct Answer - Option(D)
  • Views: 23
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

JavaScript can be written in multiple ways:

Directly into a .js file and included into an HTML page

  • Example:

Directly on the server page

  • JavaScript can be used in server-side environments like Node.js.

Directly into HTML pages using the <script> tag

  • Example:

Thus, JavaScript supports all these methods, making (D) all of the mentioned the correct answer.

<script>
alert("Hello, JavaScript!");
</script>
<script src="script.js"></script>

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.