日期:2014-05-16 浏览次数:20558 次
<script type="text/javascript">
$("input[type='checkbox']").click(function(){
var v=$(this).parent().siblings().text();
$("td[name='check_search']").html(v);
})
</script>
------解决方案--------------------
$(function () {
var cbs = $('#tb input[type=checkbox]');
cbs.click(function () {
$('#tb td[name=check_search]').html(cbs.filter(':checked').map(function () { return $(this).parent().next().html(); }).get().join())
});
});
------解决方案--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
window.onload = function() {
var $check_search = $('#check_search');
var $table = $("#tb");
$table.find('input[type=checkbox]').click(function(){
if(this.checked){
var rowIndex = this.value;
// 同辈td
var $otherTDs = $(this).parent().nextAll();
var html = [];
// 遍历TD
$otherTDs.each(function(){
html.push($(this).html());