HTML:
是否参加试驾 |
---|
你的预向车型 |
---|
您的职业 | 程序员 行政 出纳 |
---|
你结婚了吗 | 是 否 |
---|
JQ:
$(document).ready(function () {
$("#showcard").click(function () {
var ret_single = ret_download = '';
$(".single").each(function(i){
var s_name = $(this).parent().siblings().text();
var s_value = $(this).val();
if('' != s_value) ret_single += '"'+s_name+'":"'+s_value+'",';
});
$(".download").each(function(i){
var s_name = $(this).parent().siblings().text();
var s_value = $(this).val();
if('' != s_value) ret_download += '"'+s_name+'":"'+s_value+'",';
});
});
});