title: JavaScript logic not following through
body: <p>I have this calculator in JavaScript and the logic is not following through the correct way. I can't tell what's breaking the flow. The problem is that the rollRepeatCal variable is set at 6, but my logic for " &lt; 4 " is executing. I'm beginning to think there's a larger issue here. </p>
  
  <p>Here are my values: </p>
  
  <pre><code>&lt;div class="ProductProperties"&gt;
      &lt;div class="PropertiesList"&gt;
          &lt;asp:Panel ID="pnlProperties" runat="server"&gt;
              &lt;h3&gt;&lt;asp:Label ID="lblProductProperties" runat="server" Text="Product Properties" /&gt;&lt;/h3&gt;
              &lt;strong&gt;&lt;a href="wallpaper-properties.aspx" target="blank"&gt;&lt;font color="#FF0000"&gt;What are these?&lt;/font&gt;&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
              &lt;strong&gt;Material:&lt;/strong&gt; &lt;asp:Label ID="lblMaterial" runat="server" /&gt;&lt;br /&gt;
              &lt;strong&gt;Paste:&lt;/strong&gt; &lt;asp:Label ID="lblPaste" runat="server" /&gt;&lt;br /&gt;
              &lt;strong&gt;Repeat: &lt;/strong&gt;&lt;label id="lblRepeat" type="number"&gt;6&lt;/label&gt;&lt;br /&gt;
              &lt;strong&gt;Match: &lt;/strong&gt;&lt;asp:Label ID="lblMatch" runat="server" /&gt;&lt;br /&gt;
              &lt;strong&gt;Roll Width: &lt;/strong&gt;&lt;label id="lblRollWidth" type="number"&gt;20.5&lt;/label&gt;&lt;br /&gt;
              &lt;asp:Label id="divSRL" runat="server"&gt;&lt;strong&gt;Single Roll Length: &lt;/strong&gt;&lt;label id="lblSingleRollLength" type="number"&gt;16.5&lt;/label&gt;&lt;br /&gt;
              &lt;strong&gt;Single Roll Coverage: &lt;/strong&gt;&lt;label id="lblSingleRollCoverage" type="number"&gt;28 square feet&lt;/label&gt;&lt;br /&gt;
              &lt;strong&gt;Single Roll MSRP: &lt;/strong&gt;$&lt;asp:Label ID="lblMSRP" runat="server" /&gt;&lt;br /&gt;
              &lt;strong&gt;Washability: &lt;/strong&gt;&lt;asp:Label ID="lblWashability" runat="server" /&gt;&lt;br /&gt;
              &lt;strong&gt;Removability: &lt;/strong&gt;&lt;asp:Label ID="lblRemovability" runat="server" /&gt;&lt;br /&gt;
          &lt;/asp:Panel&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;p&gt;&lt;strong&gt;Calculate how much to buy: &lt;/strong&gt;&lt;label id="output"&gt;&lt;/label&gt;&lt;/p&gt;
  &lt;table&gt;&lt;tr&gt;&lt;td id="Wall" align="right"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;strong&gt;Wall Width: &lt;/strong&gt;(ft)&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="wallWidth" width="40px" value=""&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;strong&gt;Wall Height: &lt;/strong&gt;(ft)&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="wallHeight" width="40px" value=""&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
   &lt;a href="javascript: void(0)" onClick="wallpapercalc()"&gt;&lt;button&gt;Calculate&lt;/button&gt;&lt;/a&gt; 
  </code></pre>
  
  <p>Then I have my JavaScript: </p>
  
  <pre><code>&lt;script&gt;
  
      function wallpapercalc(){
  
         var widthInput = +document.getElementById('wallWidth').value,
         heightInput = +document.getElementById('wallHeight').value,
         rollWidthCal = +document.getElementById('lblRollWidth').innerText.replace('"', ' '),
         rollLengthCal = +document.getElementById('lblSingleRollLength').innerText.replace("'", " "),
         rollRepeatCal = +document.getElementById('lblRepeat').value;     
  
  
              if (rollWidthCal &gt; 15)
              {   
                  if (rollRepeatCal = &lt; 4 )
                  {
                      var repeat10 = ((((rollWidthCal / 12)*rollLengthCal) * 2)) -
                      ((((rollWidthCal / 12)*rollLengthCal) * 2)) * .10;
                      var result = (widthInput * heightInput) / repeat10;
  
                          if (result &lt;= 1) 
                          {
                              document.getElementById('output').innerText = 
                              Math.ceil(result) + " roll 10 of wallpaper";
                          }
                          else
                          {
                              document.getElementById('output').innerText = 
                              Math.ceil(result) + " rolls 10 of wallpaper";
                          }
                  }
                  else if (rollRepeatCal &gt; 3 &amp;&amp; rollRepeatCal &lt; 13)
                  {
                      var repeat20 = ((((rollWidthCal / 12)*rollLengthCal) * 2)) -
                      ((((rollWidthCal / 12)*rollLengthCal) * 2)) * .20;
                      var result = (widthInput * heightInput) / repeat20;
                      if (result &lt;= 1) 
                          {
                              document.getElementById('output').innerText = 
                              Math.ceil(result) + " roll 20 of wallpaper";
                          }
                          else
                          {
                              document.getElementById('output').innerText = 
                              Math.ceil(result) + " rolls 20of wallpaper";
                          }
  
                  }
                  else
                  {
                      var repeat30 = ((((rollWidthCal / 12)*rollLengthCal) * 2)) -
                      ((((rollWidthCal / 12)*rollLengthCal) * 2)) * .30;
                      var result = (widthInput * heightInput) / repeat30;
                      if (result &lt;= 1) 
                          {
                              document.getElementById('output').innerText = 
                              Math.ceil(result) + " roll 30 of wallpaper";
                          }
                          else
                          {
                              document.getElementById('output').innerText = 
                              Math.ceil(result) + " rolls 30 of wallpaper";
                          }
  
                  }
  
              }
              else
              {
                   var borderResult =  (widthInput / rollLengthCal); 
                   document.getElementById('output').innerText = Math.ceil(borderResult)  + " rolls of border wallpaper";
  
              }
      }
  
  
  &lt;/script&gt;
  </code></pre>