Something like this?

```JavaScript
$("#results").append($("<h2/>", {"id": "results", "class": "resultinfo"}).append("Results"));
var text = "Right: " + good_answers + ", Wrong: " + bad_answers + "."
$("#results").append($("<p/>", {"class": "resultinfo"}).append(text));
```