I am trying to detect Javascript Enabled or Disabled but from the following code, I am not getting the exact output.
<script language="Javascript" type="text/javascript">
function detectJS() {
document.getElementById("displayJS").innerHTML=true?"Enabled":"Disabled";
}
</script>
<body>
<div id="detectJS"></div>
</body>
Where am I going wrong? Please help. Thanks in advance.
var jsEnabled = trueseems kind of redundant.iddoesn't mean it will execute a function with the same name.