How to do it…

  1. First, in app/partial/_js.ejs, add the following script tag:
<script src="../../bower_components/jquery-bar-rating/dist/jquery.barrating.min.js"></script>
  1. While still in the same file, append the following line of code at the very bottom:
<%- partial("_recipe-06-14-js") %>
  1. In recipe06-14.ejs, add the following code inside the div tag with the class of wrapper:
<select id="example"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option></select>
  1. In app/partial/_recipe-06-14-js.ejs, add the DOM ready event handler:
 $(function() { $('#example').barrating({ theme: 'fontawesome-stars' }); });
  1. Just above the closing head tag ...

Get Bootstrap 4 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.