Status of Num Lock, Caps Lock, Scroll Lock, etc. is stored in memory at location number 0x417. Now C lets you use pointers and access that memory location and with the value stored there you can find out the state.
VB is a totally different thing altogether. Although, there are no pointers, there are built-in functions/controls to do this.
You can't use pointers with Javascript (thankfully!!). So unless there is a built in library function to do this, its not possible. In 15-20 minutes I couldn't find any such library function from the Javascript 1.4 Reference that I have.
So I doubt that its possible at least till Javascript 1.4
But don't lost heart, keep trying and let us all know if you find it