{"id":119,"date":"2025-08-06T21:20:30","date_gmt":"2025-08-06T21:20:30","guid":{"rendered":"https:\/\/sahidawai.com\/?page_id=119"},"modified":"2025-08-06T21:20:30","modified_gmt":"2025-08-06T21:20:30","slug":"calculate-bmi","status":"publish","type":"page","link":"https:\/\/sahidawai.com\/?page_id=119","title":{"rendered":"Calculate BMI"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n    <form id=\"bmi-calculator-form\">\n        <label for=\"bmi-weight\">Weight (kg):<\/label>\n        <input type=\"number\" id=\"bmi-weight\" required><br>\n        <label for=\"bmi-height\">Height (cm):<\/label>\n        <input type=\"number\" id=\"bmi-height\" required><br>\n        <button type=\"button\" onclick=\"calculateBMI()\">Calculate BMI<\/button>\n    <\/form>\n    <div id=\"bmi-result\"><\/div>\n    <script>\n        function calculateBMI() {\n            var weight = parseFloat(document.getElementById('bmi-weight').value);\n            var height = parseFloat(document.getElementById('bmi-height').value) \/ 100;\n            var resultDiv = document.getElementById('bmi-result');\n\n            if (!weight || !height) {\n                resultDiv.innerHTML = \"Please enter valid values.\";\n                return;\n            }\n\n            var bmi = weight \/ (height * height);\n            bmi = bmi.toFixed(2);\n            var comment = \"\";\n\n            if (bmi < 18.5) {\n                comment = \"Your BMI is \" + bmi + \". You're underweight. Focus on a nutritious diet and strength training!\";\n            } else if (bmi < 24.9) {\n                comment = \"Your BMI is \" + bmi + \". Great! You have a healthy weight. Keep up your lifestyle!\";\n            } else if (bmi < 29.9) {\n                comment = \"Your BMI is \" + bmi + \". You're overweight. Consider more physical activity and a balanced diet.\";\n            } else {\n                comment = \"Your BMI is \" + bmi + \". You're in the obese range. Consult a healthcare provider and plan your wellness journey!\";\n            }\n\n            resultDiv.innerHTML = \"<strong>\" + comment + \"<\/strong>\";\n        }\n    <\/script>\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-119","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sahidawai.com\/index.php?rest_route=\/wp\/v2\/pages\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sahidawai.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sahidawai.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sahidawai.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sahidawai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=119"}],"version-history":[{"count":1,"href":"https:\/\/sahidawai.com\/index.php?rest_route=\/wp\/v2\/pages\/119\/revisions"}],"predecessor-version":[{"id":120,"href":"https:\/\/sahidawai.com\/index.php?rest_route=\/wp\/v2\/pages\/119\/revisions\/120"}],"wp:attachment":[{"href":"https:\/\/sahidawai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}