fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <p>结果: </p> <script> $(function () { var $p = jQuery( "p" ), p = $p[ 0 ]; $p.append( jQuery.hasData( p ) + " " ); // false $.data( p, "testing", 123 ); $p.append( jQuery.hasData( p ) + " " ); // true $.removeData( p, "testing" ); $p.append( jQuery.hasData( p ) + " " ); // false $p.on( "click", function() {} ); $p.append( jQuery.hasData( p ) + " " ); // true $p.off( "click" ); $p.append( jQuery.hasData( p ) + " " ); // false }) </script> </body> </html>
运行结果