JS結合イベントの一般的な方法の簡単な分析
<?xml version = "1.0" encoding = "utf-8"?> <!doctype html public " - // w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd" xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title> js event </<cripts = "bind"> javascript "> javascript"イベント属性*利点:1:行動の分離を完了します* 2:パーティーオブジェクトを簡単に操作できます。関数は***属性として表示されるため、これを使用してパーティーオブジェクトを直接参照できます。 * 3:イベントオブジェクトを読むと便利です。イベントがトリガーされると、システムはイベントオブジェクトを自動的にイベント関数に渡します。そのうちの1つは渡されます*/ window.onload = function(){var k = document.getElementbyId( 'k')。onclick = function(event){var jj = document.getElementbyId( 'jj'); jj.style.top = event.clientx+'px'; jj.style.left = event.clienty+'px'; }} </script> <style> #k {width:60px; height:80px;バックグラウンドカラー:#80ffff;}#jj {width:60px; height:80px; background-color:#ffff00; z-index:1000; position:absolute;} </style> </head> <div div = "k"> </div> <div id = "jj"> </div> </html>上記の記事では、JSバインディングイベントの一般的な方法が私があなたと共有するすべてのコンテンツの一般的な方法を簡単に分析しています。参照を提供できることを願っています。wulin.comをもっとサポートできることを願っています。