On the page there are calculations, displayed in the form, namely in the text fields. Then I need to get the whole form with the results. The problem is that html() does not take the value text fields after the calculation.
I tried to do this
var res = 5 + 15; $("#res").val(res) $("#btn1").click(function() { var code = $("#wrapp").html(); $("#wrapp2").html(code) }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div id="wrapp"> <input type="text" id="res" /> <button id="btn1">Click</button> </div> <div id="wrapp2"></div> It does not work. The calculated value values are not transferred to the copied form.
It is necessary that when you click the button (example above) a form appears with filled values.