there is

<input id="pos_price" type="text" value="+20.25" /> valueField = parseInt(jQuery("input[id^='pos']").val()); 

in such a way I will get the whole value, and I only need the first sign, i.e. "+"

How do i get it?

    3 answers 3

     valueField = $("#pos_price").val().substr(0,1); 
       valueField = jQuery('#pos_price').val()[0]; 
         var a = "+20.25"; var b; for(var i=0; i<a.length; i++){ if(i==0){ b = a[i]; break } } console.log(b); 

        Can be even simpler

         var a = "+20.35"; var b = a[0]; console.log(b);