I would like to change value of an input field. I get the id value of the input tag through some iterations. Then I used val() to give a value. But it's not working.
My HTML is
<input type="text" id="shipping:firstname" name="billing[firstname]" value=""/>
My jQuery is
$(window).ready(function(){
var text_to_get='firstname';
var targetID = '#shipping['+text_to_get+']';
$(targetID).val("10");
});
jsFiddle is at: here
Waiting for your help!