html中的標籤帶一些數據
例如
<span class='song' data-autor='xiaoming' data-length='200' data-express='in'>菊花臺</span>
這個標籤中就帶了一些數據,如作者,長度等...你想要加入的一些數據
在jquery中的用法:
$('.author').click(function(){
var author = $(this).attr('data-author'); //這就獲取了標籤中之前設定的author了
});
些的比較簡單,如有不明白可以留言...