Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  5] [ 3]  / answers: 1 / hits: 19877  / 14 Years ago, tue, february 8, 2011, 12:00:00
$('.fav').live('click', function(e){
$(this).toggleClass('highlight');
//increase the number by 1


html:



<li class=fav light_gray_serif>5</li>


how can i use jquery to increase the number between the li everytime its clicked? thanks


More From » jquery

 Answers
16
var num = parseInt($.trim($(this).html()));
$(this).html(++num)

[#93845] Sunday, February 6, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lonnier

Total Points: 621
Total Questions: 113
Total Answers: 98

Location: Nepal
Member since Mon, Jan 4, 2021
3 Years ago
lonnier questions
;