File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,18 @@ const underageBtn = document.createElement("button");
1414underageBtn . textContent = "No, I am under 18" ;
1515document . body . append ( underageBtn ) ;
1616
17+ underageBtn . addEventListener ( "click" , ( ) => {
18+ document . body . innerHTML = "" ;
19+
20+ const underageMessage = document . createElement ( "p" ) ;
21+ underageMessage . textContent = `
22+ This BMI calculator is designed for adults (18 years and older).
23+ For children and teenagers, BMI is calculated differently.
24+ Please consult a pediatric or health professional for accurate guidance.
25+ ` ;
26+ document . body . append ( underageMessage ) ;
27+ } ) ;
28+
1729function bmiCalculator ( weight , height ) {
1830 const bmi = ( weight / ( ( height / 100 ) ** 2 ) ) . toFixed ( 1 ) ;
1931
You can’t perform that action at this time.
0 commit comments