var check=$("#timer").val(); alert(check); 
 <p id="timer" >2</p> 

  • one
    The val () method is used to get the value from the value attribute for input, select, textarea. - Ihor Tkachuk
  • $("#timer").text(); - Igor

1 answer 1

need so

 var check=$("#timer").text(); alert(check);