Using jQuery to copy some content from div to input value - value displays nicely but there`s no value in html I've got a webform in a block (using webform pay and webform block) which printing in a overridden template via module_invoke.

There is a simple price field (input). In the content type i`ve got a price field also.
I am using this kind of script to copy value from node's price div to another input field in a block:

$(document).ready(function(){
  var txt = $('.field-field-price .field-item').html();
  var txt = jQuery.trim(txt);
  $('#edit-submitted-price').val(txt);
});


The needed value displays just fine but in html value="" and i just can`t submit the form with needed value in price field. The screen-shot is attached. Thanks in advance for your time and understanding!
The value attribute for text inputs determine the initial value, it does not change when the user inputs something in the field or when it's changed by JavaScript.

If you are experience some error, it's most likely something else that's the problem.