preventDefault
??? ??
jquery PreventDefault() ?? ???
??: preventDefault() ???? ??? ?? ??? ???? ?? ?????(?: ?? ??? ??? ? ?? ?? ??).
??: ??event.preventDefault()
????:
Parameters | Description |
event | ?????. ??? ???? ???? ?? ?????. ??? ????? ??? ??? ???? ?????. |
jquery PreventDefault() ?? ?
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("a").click(function(event){ event.preventDefault(); }); }); </script> </head> <body> <a href="http://miracleart.cn/">php中文網(wǎng)</a> <p>preventDefault() 方法將防止上面的鏈接打開(kāi) URL。</p> </body> </html>
??? ????? ??? "???? ??" ??? ?????