1
我想補充我的網頁一些股利和其他tags.I想給唯一的類名這樣的:div類名或更改方法?
dataType: "json",
success: function (msg) {
var c = eval(msg.d);
var html = ''; //'<tbody>';
for (var i = 0; i < c.length; i++) {
var className = "questionContainer " + i;
html += "<div class=" + className + ">";
html += "<div class=question><b>Question" + (i + 1) + ":</b>" + c[i].Name + "?</div>";
html += "<div class=answers><ul>";
for (var j = 0; j < c[i].Choses.length; j++) {
html += "<li> <label><input type=radio name=q1" + i + i + "id=q1-a />" + c[i].Choses[j].Name + "</label></li>";
}
html += "</ul></div>";
html += "<div class=btnContainer><div class=prev></div><div class=next><a class=btnNext>Next >></a></div> <div class=clear></div></div></div>";
}
html += '</div>';
// $('#dataTable').empty();
$('.as').append(html);
}
});
});
</script>
<head>
<body>
<h1>jQuiz Demo Page</h1>
<div class="as"></div>
</body>
</head>
但我的HTML顯示
<div id="0" class="questionContainer" 0=""> like that how can I fixed?
空間必須有裏面。