如何使用jquery合并两个select语句的结果?
例如,我有
var previous = $(this).prev('td');
var next = $(this).next('td');那么我如何将这两组结果合并为一组呢?
发布于 2011-05-10 21:33:25
var all = $.merge(previous, next);发布于 2011-05-10 21:34:12
尝试:
var all=$(this).prev('td').add( $(this).next('td') );发布于 2011-05-10 21:36:37
您可以使用空集合
var previous = $(this).prev('td'),
next = $(this).next('td'),
buttons = $().add(previous).add(next);或者:
var buttons = $(this).prev('td').add($(this).next('td'));https://stackoverflow.com/questions/5950834
复制相似问题