Here is the code I am working with:
function createCardList(classname, cardName) {
console.log(classname);
var $li = $('<li class=' + classname + '>');
var $input = $('<input >', { type: 'radio', name: 'test'});
var $label = $("<label for='test'>").text(testName);
$li.append($input);
$li.append($label);
$("#card-obj").append($li);
}
for(var i=0; i<= 9; i++) {
if(i%2 == 0) {
createCardList("borderR borderB", "AAAAA");
}
else {
createCardList("borderB", "BBBBB");
}
}
When the condition in the if statement is true, the list item should look like this:
<li class="borderR borderB">
However, the current output looks like this:
<li class="borderR" borderb><li>
How can I correct this issue?