JSFiddle - React, Tailwind, and code Playground
HTML
<p>
<input type="checkbox" />I do agree to give full ownership of my soul to musefan</p>Sign:
<input type="text" />
<br/>
<br/>
<a>Click to Collect Reward</a>
CSS
input {
border:none;
border-bottom:1px solid #000;
outline: none;
}
JavaScript
$('a').click(function (e) {
setValueProperties();
var html = getHtml();
alert(html);
});
function setValueProperties() {
$('input').each(function () {
switch ($(this).attr("type")) {
case "checkbox":
if ($(this).is(":checked")) {
$(this).attr("checked", true);
} else {
$(this).removeAttr("checked");
}
break;
case "text":
$(this).attr("value", $(this).val());
break;
}
});
}
function getHtml() {
return document.documentElement.outerHTML;
}