First, we need to prepare some elements that indicate the element is resizable. They are placed absolutely at the four sides of the original element.
Convert a string into an integer (a whole number)
Convert a string into an integer (a whole number).
Remove a class from HTML element
Use Element.classList and DOMTokenList.remove() to remove the specified class from the element.
Make a draggable element
In order to make an element draggable, we need to handle three events.
Template Literals
Template literals provide a simpler way to create strings that span multiple lines or contain data.
Looping over an object’s keys and values
In this example you have access to each pair using the key and value variables during the loop.
Take a number and return it in the specified currency formatting
Use Intl.NumberFormat to enable country / currency sensitive formatting.
Drag to scroll
This post shows you a simple way to allow users to scroll by dragging the element with vanilla JavaScript.
Determine if a string contains a substring
String.indexOf() returns the index of where the substring starts in the string, or -1 if the substring isn’t found.
Finding a specific object in an array of objects
Iterating through an array of objects to find a specific one.