How to Detect Javascript On/Off, With Notification?

<script type=”text/javascript”> document.write(“Welcome, you have Javascript on.”) </script> <noscript>JavaScript is off. Please enable to view full site.</noscript>