<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="author" content="bbbbb" /> <title>Untitled 2</title> <script type="text/javascript" src="js/jquery-1.5.1.js"></script> <style> #test ul{list-style:none;} #test li{width:75px;height:25px;padding-left:25px;padding-right:25px;padding-top:10px;padding-bottom:10px;} .active{background:#AEABAB;} a.active{color:#ffffff;} </style> </head> <body> <script type="text/javascript"> $(document).ready(function() { $(document).keydown(function(e) { switch(e.keyCode) { case 38: // up arrow window.location.href = 'index.html'; break; } }); }); </script> <div id="test"> <ul> <li class="active"><a href="test.html">Home</a></li> <li><a href="#">My work</a></li> <li><a href="#">Blog</a></li> <li><a href="#">News</a></li> </ul> </div> </body> </html> i don't want to use "window.location.href = 'index.html';" but want to click my navigation link using click method is it possible???
i have created a page for keyboard navigation!
.click()to navigate to a link. See stackoverflow.com/questions/6927215/…