title: jquery If element id is similar to other element then add class
body: <p>I've been racking my brain over this one the past few days and i'm hoping someone can help.
  Basically here's what I have...</p>
  
  <pre><code>&lt;div id="ORDER/SUB/DD" class="box1"&gt;content&lt;/div&gt;
  &lt;div id="ORDER/GIFT/CC" class="box1"&gt;content&lt;/div&gt;
  &lt;div id="ORDER/SUB/CC" class="box1"&gt;content&lt;/div&gt;
  
  &lt;div id="ORDER/GIFT/CC/1" class="box2"&gt;content&lt;/div&gt;
  </code></pre>
  
  <p>All of the <code>box1</code> ids are however dynamically created and what i want is to add a new class <code>chosenOffer</code> to the <code>box1</code> div that's id is in that of the <code>box2</code> div.
  So it will look like the following...</p>
  
  <pre><code>&lt;div id="ORDER/SUB/DD" class="box1"&gt;content&lt;/div&gt;
  &lt;div id="ORDER/GIFT/CC" class="box1 chosenOffer"&gt;content&lt;/div&gt;
  &lt;div id="ORDER/SUB/CC" class="box1"&gt;content&lt;/div&gt;
  
  &lt;div id="ORDER/GIFT/CC/1" class="box2"&gt;content&lt;/div&gt;
  </code></pre>
  
  <p>The <code>box2</code> div will always have an id matching one of the <code>box1</code> divs except with some extra characters (like the slash and number in the example). Any help greatly appreciated!</p>