You can only add the .min.css & .min.js files from the following library to your head code of the page and you will have a toggle button from a check-box. The only thing you need to do for a check-box to be turned into a toggle button is to add the ( data-toggle="toggle" ) attribute to it. Reference : https://www.bootstraptoggle.com/
Sometimes, when a modal appears you donot want to be hidden if you clicked outside it in the gray area around it in the whole page. to prevent that behavoir, Use the following small code to prevent all modals from this action:
Whenever you need an input field, that will hold multiple tags-like words, by writing and pressing just Enter button, then you will definitely need this code snippet.