[Javascript] Keypress and a name jump

Guillaume javascript at webdesignofficina.com
Wed Jan 3 11:04:36 CST 2007


Hi folks and happy new year to everybody...

I'm using the function below to detect a keypress and I'd like also when this key is pressed to jump 
to a <a name"thereUgo"> in my document...

How do I add this feature to the code below ?

Thanks.

Guillaume.


function getKey(e){

    if (e == null) { // ie

        keycode = event.keyCode;

    } else { // mozilla

        keycode = e.which;

    }

    key = String.fromCharCode(keycode).toLowerCase();

    

    if(key == 't'){ myFunction(); }


 return false; }

}




More information about the Javascript mailing list