0
我有一個這樣的HTML元素:添加鼠標懸停事件有關的動態上的HTML元素
<div id="new"></div>
我想追加的onmouseover功能,將文本追加到這個元素是這樣的:
<div id="new" onmouseover="show_pop()"></div>
什麼是這個jQuery功能?
我有一個這樣的HTML元素:添加鼠標懸停事件有關的動態上的HTML元素
<div id="new"></div>
我想追加的onmouseover功能,將文本追加到這個元素是這樣的:
<div id="new" onmouseover="show_pop()"></div>
什麼是這個jQuery功能?
你想:
$('#new').mouseover(function() {show_popup();});
或者,如果你真的想它實際上添加到節點(您可能沒有),那麼這樣的:
$('#new').attr('onmouseover', 'show_popup()');
謝謝你幫助 –