The "value" attribute displays the .defaultValue property.
There is no attribute that maps to the .value property. However, on non-polluted inputs , you can set the "value" attribute (and, obviously, .defaultValue ), and this will be reflected in the .value property.
Since your entrance is not dirty, you can do it
var $obj = jQuery('<div>xx<input type="text" value="" />xx</div>'); $obj.find('input').prop('defaultValue', 'testing'); console.log($obj.html()); //xx<input type="text" value="testing">xx
source share