javascript - Change presentation of <input> field -


i have <input> field in form below:

<input     class="form-control"     data-filter="m"     id="id_options_price"     name="options_price"     tabindex="141"     type="text"     value="121000.00"> 

how can change presentation of input, allow display field on page 121 000,00 (with space between digit group) keeping value , type attributes are.

is there way js?

"is there way javascript?"

supposing it's refering object duplication method, yes, can show in jquery.

we need insert new element after our input :

$( "#id_options_price" ).after( "<div class='price'>"+$("#id_options_price").val()+"</div>" ); 

and hide original input :

$( "#id_options_price" ).hide(); 

of course, theses line should called after page loaded, i. e. :

$( document ).ready(function() {      $( "#id_options_price" ).after( "<div class='price'>"+$("#id_options_price").val()+"</div>" );     $( "#id_options_price" ).hide(); }); 

Comments