返回值:Object event.result
V1.3 概述
這個屬性包含了目前事件事件最後觸發的那個處理函式的返回值,除非值是 undefined 。
示例
描述:
顯示前一個事件處理函式的返回值。
程式碼:
<!DOCTYPE html> <html> <head> <script src="//code.jquery.com/jquery-latest.min.js"></script> </head> <body> <button>display event.result</button> <p></p> <script> $("button").click(function(event) { return "hey"; }); $("button").click(function(event) { $("p").html( event.result ); }); </script> </body> </html>