JSFiddle - React, Tailwind, and code Playground
JavaScript
var checkBoxAuto = $("<input />", {
id: "idAuto"
, type : "checkbox"
, class: "answer"
, checked : "checked"
});
var checkBoxAutoText = $("<div />")
.append(checkBoxAuto)
var outerHtml = checkBoxAuto.map(function(){
return $(this).parent().html();
}).get();
alert(outerHtml);