I am having some values in my paragraph tag. I am trying to get the values from the paragraph tag. But I am unable to get the values. For example,
HTML Code:
<
As a string :
var str = $('#value').text()
As a number :
var nb = parseInt($('#value').text().trim(), 10);
you want to do
var value = $('#value').html();
That should give you the value you're looking for. The html() function returns all the html code within the selector. In your case it's just the text.
If you want that as a number instead of a string just wrap it in parseInt()
var integer_value = parseInt($('#value').html());