title: If body has this class, then place this content in #mydiv, else place other content in #mydiv
body: <p>JS beginner here. </p>
  
  <p>I need help with a script to place different content in a div depending on whether the page body tag has a class of "home" or not. </p>
  
  <p>I am trying to use .hasClass &amp; .html to achieve this. It seems like it should be extremely straightforward, but I can't figure it out. Lack of proper syntax knowledge? Incorrect declarations? I don't know, and am hoping someone can point me in the right direction!</p>
  
  <pre><code>    if ($("body").hasClass("home") == true) {
              ("#mobilemenu").html("&lt;a href="#"&gt;HOME&lt;/a&gt;");
      }
      else {
              ("#mobilemenu").html("&lt;a href="#"&gt;NOT HOME&lt;/a&gt;");
      }
  </code></pre>
  
  <p>the JSFiddle (which currently does nothing) is here: 
  <a href="http://jsfiddle.net/aqyN4/" rel="noreferrer">http://jsfiddle.net/aqyN4/</a></p>
  
  <p>Links to other JSFiddles or questions with similar functions extremely welcome!</p>
  
  <p>Thank you,</p>
  
  <p>Ali</p>