<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <br/><br/><br/><br/> <script src="/cloudstore/resource/pc/jquery/jquery.min.js"></script> <table> <tr> <td>客户名称:</td> <td><input type="text" name="companyName" id="companyName"/></td> </tr> <tr> <td>客户地址</td> <td><input type="text" name="address" id="address" /></td> </tr> </table> <script type="text/javascript"> $(document).keydown(function(event){ //按下F8事件 if(event.keyCode==119) { console.log("F8-PAI事件"); console.log($("#companyName").val()); console.log($("#address").val()); } }) $(document).keyup(function(event){ //alert(event.keyCode) //抬起F8事件 if(event.keyCode==119) { console.log("F8-PBO事件-渲染html页面"); } }) </script> </body> </html>
标签:console,log,F8,原理,PAI,PBO,event From: https://www.cnblogs.com/hua900822/p/17422810.html