title: Assign a title in html by using javascript
body: <p>So, I have an html file that I am naming my page in this line: </p>
  
  <pre><code>&lt;a id="myTitle" class="brand" style=" margin-left: 110px"&gt;Title&lt;/a&gt;
  </code></pre>
  
  <p>I would like to change the title, based on what page I am in. Right now, I change the URL to signify what page I'm on: </p>
  
  <pre><code>switch(page) {
          case "local":
              url += location.hostname;
              switch(datasource) {
              default:
                  url += ":9001";
              }
              return url;
          case "second":
              url += "first-";
              break;
          case "third":
              url += "second-";
              break;
          }
  </code></pre>
  
  <p>The URL part works correctly, adding the local data, the "first" name, and the "second" name in my URL. I would like to attach these names on my page as it changes. so if I'm on the "first" I want the title on the page to display: </p>
  
  <p>first title</p>
  
  <p>if I'm on the "second" url, I want the title on the page to display:</p>
  
  <p>second title</p>
  
  <p>I tried adding</p>
  
  <pre><code>$("#myTitle").append("local");
  </code></pre>
  
  <p>but all that does is give me </p>
  
  <p>titlelocallocallocallocallocal....</p>
  
  <p>Is there a way to do this using jquery? javascript? I prefer jquery. Thanks guys!</p>