我正在尝试将数据消息传递给 div,这是当前设置:
html
<a data-message="my message" href="www.site.com">Click here</a>
<div class="new-window" style="display: none;">
<p>(message should be here)</p>
</div>
js
$('a[data-message]').click(function(){
$('.new-window').fadeIn(300).text($('.new-window p').data('message'));
return false;
});