Make a button show if a sentence :contains (password)

Make a button show if a sentence :contains (password)

My JS;
  1. $(document).ready(function(){
  2. if ($(".wrapfix:contains('password')").length) {
  3. $(".buttonprotectedbox").removeClass("buttonprotectedbox").addClass("showbutton");
  4. } else { 
  5. $(".buttonprotectedbox").show();
  6. });
My html: (its phpbb)
  1. <div class="wrapfix"> 
  2. <div class="buttonprotectedbox">
  3. <a title="Password Protected Forum." class="ui-button ui-widget ui-state-default ui-corner-all buttonprotected">Protected</a> 
  4. </div>

  5. <!-- IF forumrow.FORUM_DESC --><br /> <span class="forumdesc">{forumrow.FORUM_DESC}</span> <!-- ENDIF -->
  6. </div>


My CSS;

  1. .wrapfix {
  2. display: inline;
  3. }


  4. .buttonprotected {
  5. display: none;
  6. }


  7. .wrapfix .showbutton {
  8. display: inline;
  9. }

So the goal is that when {forumrow.FORUM_DESC} contains the word "password" it will show the protected button.


I think I'm close to getting it to work but what am I missing here?  I don't need jquery to scan the whole forum index just the one row of a forum that has the word password in its description.