title: Add class name to element outside current container
body: <p>How do I add a class name outside the current container, based on the <code>id</code> and/or the BS attribute?</p>
  <p>Example code:</p>
  <pre><code>&lt;ul class=&quot;nav&quot;&gt;
      &lt;li class=&quot;nav-item is-active&quot;&gt;
         &lt;a href=&quot;#&quot; data-bs-target=&quot;#nav-1&quot;&gt;Lorem Ipsum&lt;/a&gt;
       &lt;/li&gt;
       &lt;li class=&quot;nav-item&quot;&gt;
          &lt;a href=&quot;#&quot; data-bs-target=&quot;#nav-2&quot;&gt;Lorem Ipsum&lt;/a&gt;
       &lt;/li&gt;
       &lt;li class=&quot;nav-item&quot;&gt;
          &lt;a href=&quot;#&quot; data-bs-target=&quot;#nav-3&quot;&gt;Lorem Ipsum&lt;/a&gt;
       &lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;div class=&quot;tab-content&quot;&gt;
       &lt;div class=&quot;tab-pane&quot; id=&quot;nav-1&quot;&gt;
           &lt;p&gt;Lorem Ipsum&lt;/p&gt;
       &lt;/div&gt;
       &lt;div class=&quot;tab-pane&quot; id=&quot;nav-2&quot;&gt;
            &lt;p&gt;Lorem Ipsum&lt;/p&gt;
       &lt;/div&gt;
       &lt;div class=&quot;tab-pane&quot; id=&quot;nav-3&quot;&gt;
             &lt;p&gt;Lorem Ipsum&lt;/p&gt;
       &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Take for example the first <code>li</code>. It has <code>is-active</code> class, its <code>a</code> has attribute <code>#nav-1</code>. I want to be able to add a class name <code>active</code> to <code>&lt;div class=&quot;tab-pane&quot;&gt;</code> with the <code>id=&quot;nav-1</code>. Is that possible?</p>