document.getElementById('js').display = 'none';
I'm not sure if I asked my question right or not.
Say there was a function in JS to detect if it was enabled or not, - it would never even run if JS was disabled so it loses its purpose!
You do realise, that your question is irrational, right?
window.location = "http://www.mysite.com/index-js.html";
That's a poor way of doing it though, because you'll be having to maintain two different versions which always leads to trouble.
Previously sites were developed with gracious degredation in mind, so that features would be added on to allow for the possibility that certain functionality may not be available.
If it's not then there is no programming language, so the answer is no.