How to Hide Unwanted Script Using Comment in JavaScript ?

How to Hide Unwanted Script Using Comment in JavaScript ?

  1. We are using Comment for User Reference.
  2. Comments can be used to hide unwanted data in JavaScript.
  3. Comments can be useful while testing your application.

Hide Your Unwanted Code Like this -

<html>
<head>
<title>Hide scripts using comments.</title>
<script language="javascript" type="text/javascript">
<!--
lines of JavaScript code here
...
//-->
</script>
</head>
<body>