var div = $('<div/>');div.data('foo', {bar: 'foobar'});alert(div.data('foo')); // gives "[object Object]"alert(typeof div.data('foo')); // gives "object"alert(div.data('foo').bar); // gives "foobar"​​​​​​​​​​​​​​ 这篇关于jQuery,将对象(而不是字符串属性)附加到元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-06 12:34