title: Jquery - Replace Variables
body: <p>I'm looking to create a jQuery script that will replace an html variable if and only if it is inside a certain div. I'd like it to do this for each PostID though.</p>
  
  <p>Each variable is unique depending on the post id.</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;div class="[PostID]"&gt;
  &lt;div class="special"&gt;
  &lt;div class="container"&gt;
  (Variable 1 has been replaced by variable 2 here due to the Special class)
  [Variable 2]
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I created a quick script but the problem I have is that when the first variable 2 is replaced, that is also the variable that is used to replace the following special classes. They aren't using their own variable.</p>
  
  <p>Sorry if this is confusing.</p>
  
  <p>Thank you.</p>