$(data).each(function (index, ticketFormMap) { var book = "<td type='submit' onclick='textdd()' class='btn btn-primary btn-block'>"+"预订"+"</td>"; $('#ticketinfo').append( "<tr>" + "<td>" + ticketFormMap.planeInfo + "</td>" + "<td>" + ticketFormMap.planeType + "</td>" + "<td>" + ticketFormMap.startCity + ticketFormMap.startTime + "</td>" + "<td>" + ticketFormMap.arrivalCity + ticketFormMap.arrivalTime + "</td>" + "<td>" + ticketFormMap.stopOver + "</td>" + "<td>" + ticketFormMap.meal + "</td>" + "<td>" + ticketFormMap.luggagePrice + "</td>" + "<td>" + ticketFormMap.berth + "</td>" + "<td>" + ticketFormMap.seating + "</td>" + "<td>" + ticketFormMap.savemoney + "</td>" + "<td>" + ticketFormMap.price + "</td>" + book + "</tr>")})
3 回答
Chanceshine
TA贡献1条经验 获得超0个赞
h5:<td class="getid" data-id="**">预订</td>
js:
$('.getid').on('click', function (e) { var id = $(this).data('id'); //取出你点击的ID }
应该没问题吧
添加回答
举报
0/150
提交
取消