jQuery select element id from String : <p>Ok, So I am a little noob here and I think that my terminology might be wrong so please feel free to correct me (I need to learn).</p>

<p>I want to create a better user experience on an FAQ page and ask the user if the question was helpful. If not provide an Alternative. I am trying to add a class to a div that contains the question. </p>

<p>Here is a fiddle example: <a href="https://jsfiddle.net/u596vwwn/" rel="nofollow noreferrer">https://jsfiddle.net/u596vwwn/</a></p>

<p>Here is the jQuery:</p>

<pre><code>  $(document).ready(function() {
    $('.faq-question').click(function() {
      var question = $(this).attr('href');
      question = question.replace('#', '');
      var questionData = document.getElementById(question).innerHTML;
      document.getElementById(question).innerHTML = questionData + '&lt;div class="row further-help"&gt;Did this answer your question? &lt;span id="further-help-yes"&gt;Yes&lt;/span&gt; | &lt;span id="further-help-no"&gt;No&lt;/span&gt;&lt;/div&gt;';
    });

    $('body').on('click', '#further-help-yes', function() {
      $(this).parent('.further-help').fadeOut();

    });

    $('body').on('click', '#further-help-no', function() {
      $(this).parent('.further-help').html('Please contact us &lt;a href="#"&gt;here&lt;/a&gt;.');

    });
  });
</code></pre>

<p>What I want, when the user clicks the link in the fiddle. The div container the question will then have a class added so that I can style it.</p>

<p>I tried getting the element like so: </p>

<pre><code> var questionContainer = document.getElementById(question);
</code></pre>

<p>and then add a class like so:</p>

<pre><code>questionContainer.addClass('selected-faq');
</code></pre>

<p>but it is not adding it. </p>
