$(function(){ $(".option").click(function(){ $(this).toggleClass("checked"); }); $(".nextList").click(function () { if($(".container>div").hasClass("checked")){ /*alert($(this).prev().children().text());*/ alert($(this).prev().children().find(".checked").text()) }else{ alert("请选择答案") } }) })