#使用jquery获取data-index的值 jquery 的版本最好高一些
#html <div id = 'div'><span data-field='demo'></span></div> #js alert($('#div>span').data('field')); 输出:demo