title: Userscript, how to replace HTML tag and attributes
body: <p>I am trying to change the HTML tag and remove the class/style attributes after the tag.
  I already know how to do this if I create the code before hand and replace, now I want to know how to find the tags on an already loaded page and replace them with my js.</p>
  
  <pre><code>var s = "&lt;h2 class=\"title\" style=\"font-color: red;\"&gt;Blog Post&lt;/h2&gt;";
  s = s.replace("&lt;h2 class=\"title\" style=\"font-color: red;\"&gt;","&lt;p&gt;");
  s = s.replace(/&lt;\/h2&gt;/g, "&lt;/p&gt;");
  </code></pre>
  
  <p><em>Start with</em>
  <code>&lt;h2 class="title" style="font-color: red;"&gt;Blog Post&lt;/h2&gt;</code></p>
  
  <p><em>End with</em>
  <code>&lt;p&gt;Blog Post&lt;/p&gt;</code></p>
  
  <p>So the question is how can I create the <code>var s</code> with existing HTML?
  How do I find <code>h2.title</code> on a page and give it to <code>var s</code>?</p>
  
  <p><strong>edit</strong> I have no javascript experience except for this script which I found and tweaked.
  Please explain how I can grab  text  from an existing document, and make it my var for s.replace to manipulate.  </p>