JSFiddle - React, Tailwind, and code Playground
HTML
<input id="test" type="text">
<input type="button" id="foo" value="press me">
JavaScript
$(function(){
$.fn.fullHTML = function(){
var $this = $(this);
return $('<div>')
.append($this.clone())
.remove()
.html()
.replace('<input ','<input value="'+ $this.val() +'" ');
};
$("#foo").click(function(){
alert ( $("#test").fullHTML() );
});
});