tags:

views:

32

answers:

3

Sill Q I know - sorry in advance - but how do you read a decimal point value in JQuery. e.g.

<input type="text" name="test" value="1.23">

Then take that value "1.23" into something like this

var test   = $(this).val();
$(this).next('.txt').text(test);

Where .txt is the "next" div with a class of txt and "$(this)" is the input

A: 

Your question is not clear but you can read a value using .val() function in jquery.

Krunal
A: 

I'm not sure what you're looking for. It looks okay to me. It could be shortened down to this:

$(this).next('.txt').text($(this).val())
Deniz Dogan
A: 

HTML

   <input type="text" id="test" name="test" value="1.23">
    <div class='txt'></div>

JQuery

$('#test').next('.txt').text($('#test').val());

Demo is here.

Kai