I would like to use jQuery to wrap sets of class elements in a div but can\'t find the solution.
div
HTML:
Use wrapAll() method
$(function(){ var classes = ['.first', '.second', '.third']; for (i = 0; i < classes.length; i++) { $(classes[i]).wrapAll(''); } }); Demo: http://jsfiddle.net/g9G85/ 0 讨论(0) 查看其它5个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
Demo: http://jsfiddle.net/g9G85/