Comparing Elements inside an If else condition in Jquery
<p>This is my first time asking here on Stackoverflow,</p>

<p>Here is my HTML code,</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="accordion" style="height: auto;"&gt;
  &lt;h3&gt;Question 1&lt;/h3&gt;
 &lt;div&gt;
  &lt;div id="q1"&gt;
 Sending messages from another user's email address is called what?  
    &lt;ul&gt;
 &lt;li&gt;&lt;button type="button" class="btn btn-secondary btn-sm optionbutton" data-optionId="option1"&gt;Spamming&lt;/button&gt;&lt;/li&gt;
 &lt;li&gt;&lt;button type="button" class="btn btn-secondary btn-sm  optionbutton" data-optionId="option2"&gt;Trolling&lt;/button&gt;&lt;/li&gt;
 &lt;li&gt;&lt;button type="button" class="btn btn-secondary btn-sm optionbutton answer  active clicked" data-optionId="option3"&gt;Spoofing&lt;/button&gt;&lt;/li&gt;
 &lt;li&gt;&lt;button type="button" class="btn btn-secondary btn-sm optionbutton" data-optionId="option4"&gt;Pharming&lt;/button&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/div&gt; &lt;!-- q1 --&gt;
  &lt;/div&gt;
&lt;h3&gt;Question 2&lt;/h3&gt;
&lt;div&gt;
 &lt;div id="q2"&gt;
    How many zebibytes are in a yobibyte?
    &lt;ul&gt;
    &lt;li&gt;&lt;button type="button" class="btn btn-secondary btn-sm optionbutton answer" data-optionId="option1"&gt;1,024&lt;/button&gt;&lt;/li&gt;
    &lt;li&gt;&lt;button type="button" class="btn btn-secondary btn-sm optionbutton" data-optionId="option2"&gt;1,048,576&lt;/button&gt;&lt;/li&gt;
    &lt;li&gt;&lt;button type="button" class="btn btn-secondary btn-sm optionbutton" data-optionId="option3"&gt;1,000,000&lt;/button&gt;&lt;/li&gt;
    &lt;li&gt;&lt;button type="button" class="btn btn-secondary btn-sm optionbutton active clicked" data-optionId="option4"&gt;1,000,000,000&lt;/button&gt;&lt;/li&gt;
    &lt;/ul&gt;
   &lt;/div&gt;&lt;!-- q2 --&gt;
    &lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>And Here is my Jquery Code</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>var q1input = 0;
var q2input = 0;
var q3input = 0;
var q4input = 0;
var q5input = 0;
    var optionele1 = $("#q1").find("button.active.clicked");
 var optionele2 = $("#q2").find("button.active.clicked");
 var optionele3 = $("#q3").find("button.active.clicked");
 var optionele4 = $("#q4").find("button.active.clicked");
 var optionele5 = $("#q5").find("button.active.clicked");
 var answerele1 = $("#q1").find("button.answer");
 var answerele2 = $("#q2").find("button.answer");
 var answerele3 = $("#q3").find("button.answer");
 var answerele4 = $("#q4").find("button.answer");
 var answerele5 = $("#q5").find("button.answer");
 if( optionele1.is(answerele1) ){ q1input = 100; }else{}
 if( optionele2.is(answerele2) ){ q2input = 100; }else{}
 if( optionele3.is(answerele3) ){ q3input = 100; }else{}
 if( optionele4.is(answerele4) ){ q4input = 100; }else{}
 if( optionele5.is(answerele5) ){ q5input = 100; }else{}</code></pre>
</div>
</div>
</p>

<p>The question is, How should I compare the two elements in jquery? or there any wrong syntax in my code? Help please. I'm stuck here.</p>