0
をトリガしません:なぜ「TR」「のonmouseover」イベントは、私がテーブルを持っている
<table id="someId" class="someClass" style="width:50%" border=1>
<tr id="data">
<td>Row 0, Column 0</td>
<td>Row 0, Column 1</td>
<td>Row 0, Column 2</td>
</tr>
<tr id="data">
<td>Row 1, Column 0</td>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
</tr>
<tr id="data">
<td>Row 2, Column 0</td>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>
私は、行の上にマウス、行の背景色がを変更することが機能を実装するためにfollwoingのjQueryを使用します:
$("tr#data").onmouseover(
function() {
$(this).css('bgcolor', '#77FF99');
}
);
私はまた、 "ホバー"両方が動作していないしようとしている、なぜですか?
感謝を!私はhttp://www.w3schools.com/tags/tag_tr.aspここに "tr"要素の "onmouseover"機能があり、この参照が間違っていると思われる参照をチェックしました。 – Mellon
jQueryのイベント名とHTMLイベントハンドラの属性名は同じではありません。必ずjQueryのドキュメントを参照してください。 – Marian