We have a page which requires user to enter some input and post submission (e.g. by hitting开发者_开发百科 Enter key or Submit button). The answer is shown to the end user and we provide a link which says 'Press any key to continue'.
The focus on the input box is automatically shown, either after pressing any key or by clicking on the link. Can someone provide some sample code to do this?
Try this:
$('#other').click(function() {
    $('#target').focus();
});
$("a").mousedown(function(){
    alert('keypressed');
});
$.keypress(function(){
    alert('keypressed');
});
try this too...
 $('#link').click(function() {
        $('#inputbox').focus();
    });
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论