Is there a better way to add the selected class without duplicating the markup?

selectedClass = data.results.length === 1 ? " class=\"selected\"" : "";
html += "<li" + selectedClass + "><a href=\"" ....