javascript - Open pop window on enter key -
i need open pop window (www.google.com) has link of other site, on pressing enter key in text field. alert message not pop window.
here have got now
$('input').bind("enterkey",function(e){ alert("enter"); }); $('input').keyup(function(e){ if(e.keycode == 13) { $(this).trigger("enterkey"); } }); please let me know how new pop window opened.
did try this?
$('input').bind("enterkey",function(e){ window.open("http://www.google.com",'name','width=800,height=400'); }); $('input').keyup(function(e){ if(e.keycode == 13) { $(this).trigger("enterkey"); } });
Comments
Post a Comment