title: Bootstrap switch not rendering in view
body: <p>I am trying to use bootstrap switch in a view so in my layout file I have referenced the required files.</p>
  
  <p>_Layout.Cshtml</p>
  
  <p>Header</p>
  
  <pre><code>&lt;link rel="stylesheet" href="~/css/bootstrap-switch.css" /&gt;
  </code></pre>
  
  <p>Footer</p>
  
  <pre><code>&lt;script src="~/js/bootstrap-switch.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>However in my view I have</p>
  
  <pre><code>  @Html.CheckBox("DisableBuyButton", true)
  </code></pre>
  
  <p>Then in my footer of my layout page I have the following</p>
  
  <pre><code> $("[name='DisableBuyButton']").bootstrapSwitch();
  </code></pre>
  
  <p>But I am getting the following in my google chrome inspector</p>
  
  <p><a href="https://i.stack.imgur.com/y2ft9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y2ft9.png" alt="enter image description here"></a></p>
  
  <p>As you see it is showing a unexpected token import and when I click into the error it brings me to this line. I am no jquery expected so hope someone can help me.</p>
  
  <pre><code>import jquery from 'jquery';
  </code></pre>
  
  <p>Does someone have an idea what may be wrong</p>
  
  <p>Edit 2 I have got rid of those errors but the error above still exists.</p>
  
  <p><a href="https://i.stack.imgur.com/VrJFF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VrJFF.png" alt="enter image description here"></a></p>
  
  <p><strong>Edit 3</strong></p>
  
  <p>OK so now I used the cdn and its working but its put two switches beside one another.</p>
  
  <p><a href="https://i.stack.imgur.com/Q7BzF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q7BzF.png" alt="enter image description here"></a></p>
  
  <p>When I clearly Have them seperated in code </p>
  
  <pre><code> &lt;script&gt;
        $(document).ready(function () {
            $("[name='DisableBuyButton']").bootstrapSwitch();
            $("[name='IsRental']").bootstrapSwitch();
  
         });
  &lt;/script&gt;
  
  
  &lt;div class="col-md-10"&gt;
   &lt;div class="form-group"&gt;
         Disable By Button
            &lt;input type="checkbox" asp-for="DisableBuyButton" id="DisableBuyButton" /&gt;
  
     &lt;/div&gt;
      &lt;div class="form-group"&gt;
  
         &lt;input type="checkbox" asp-for="IsRental" id="IsRental" /&gt;Is Rental
  
      &lt;/div&gt;
  </code></pre>