change background image

change background image

hi there
i have code below

  1.   if($('ul#nav li').hasClass('wp_home'))
  2.                                                            {
  3.                                             $('ul#nav li.wp_home').click(function() {
  4.                                          $(this).addClass("current_page_item");
  5.                                         
  6.                                          
  7.                                                                      });
  8.                                                            }
i just want to check whether li contain specific class or not if yes then then add new class to it only after it is click

any help appreciated
thank you