Finding title in content using contains()

Finding title in content using contains()

Is it possible to do: if first word in #title appears anywhere in #content than change color of #title to green? I tried an if statement but Im not sure whats going on there. Also im trying it with one line of jquery but Im getting lost in the stacking of methods/selectors. I doubt I can do it with just one line of jquery. 

  1. <p id='title'> 
  2. paragraph 
  3. </p>

  4. <p id='content'>
  5. this is a paragraph
  6. </p>

  7. $("#content * :contains(#title.text())").css('color','green');
  8.       //---OR---
  9.       //(below I'm only trying to see if I can atleast get x and z to return true- which I cannot.)

  10. var x = $('#title').text(); 
  11. var z = 'paragraph';
  12.  if (x === z){ 
  13. alert(x); 
  14. };