简体   繁体   中英

how to include a bootstrap plugin(input spinner) present in node module folder inside a html file.?

  1. In my project I want to include a (input-spinner ) in my HTML file.
  2. I run the npm install bootstrap-input-spinner command.
  3. A node module folder and package lock.json was created along with my HTML file
  4. In HTML, I created a link for that plugin but this is not working.

My HTML body code:

<body>
    <div class="container">
        <h1> Calculator</h1>

        <div class="card">
            <div class="card-body">
                <input type="number" value="0" min="0" max="100" step="1"/>
            </div>
          </div>

    </div>
      <script src="/node_modules/bootstrap-input-spinner.js"></script>
      <script>
           $("input[type='number']").inputSpinner();
      </script>
</body>

I also include bootstrap cdn in my project

your script tag should look like this:

<script src="./node_modules/bootstrap-input-spinner/src/bootstrap-input-spinner.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM