<span id="shortfall" style="color:black">1</span> views
is there a way to get this by jquery?
when the user refresh the page,the number auto increment one(2,3,4…..). how to do it? thank you,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you can use the Web Storage API it should be quite simple (you could also use
sessionStorage, depending on what you’re actually trying to achieve):Here’s a working example. You could also use cookies, or you could do it server side (e.g. with a PHP session). I’m not entirely clear on whether you are intending the number to increment for each user, or a total for all users… if it’s the latter, you’re going to have to do it server side!