Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以基本上我试图在被截断之前获取文本的初始值并将其填充到 rel 属性中,同时截断被截断的文本。
我似乎无法弄清楚如何让函数在截断之前返回文本的值!
有任何想法吗?
http://jsfiddle.net/TF6Rb/625/
为什么不直接抓取文本并将其塞入其中,rel然后再对它进行任何操作?
rel
var text = el.html(); el.attr('rel', text); // etc