首先,我不认为id的空格是有效的.
所以我将id更改为不包含空格.
<label year="2010" month="6" id="currentMonth"> June 2010</label>
然后jquery代码很简单(请记住,最好一次获取jquery对象并使用遍历agian)
var label = $('#currentMonth');
var month = label.attr('month');
var year = label.attr('year');
var text = label.text();