Simple Javascript BMI calculator that copies result to clipboard
I worked on a project recently where I needed a custom BMI calculator. There are plenty of BMI calculators out there, but I wanted to make a couple slight tweaks:
- Since most people (in the U.S.) are not going to know their weight in kg or height in cm, limit options to entering height in feet and inches and weight in pounds
- Copy the result to the clipboard upon clicking “Submit”
The result was a combination of a couple of scripts – a basic calculator script on Stack Overflow, and a copy to clipboard script from W3 schools. You can check it out here: