자유게시판

IT HUB를 찾아주셔서 감사합니다.

기타 BMI 계산 공식

페이지 정보

profile_image
작성자 하나를하더라도최선을
댓글 0건 조회 2,584회 작성일 23-10-03 14:19

본문

공식:)

BMI = 키/((체중/100)^2)


구간별 비만 상태:)

BMI < 18.5 = 저체중

BMI < 23 = 정상

BMI < 25 = 과체중

BMI >= 25 = 비만



아래는 h t t p s : / / h e a l t h. s e o u l m c. o r. k r / h e a l t h C a r e I n f o / m y B M I P o p u p. d o 사이트의 소스코드를 발췌한 것입니다. 

<body>
    <div id="pop-wrap" class="green">
        <div class="pop-header">
            <h1>나의 체질량지수(BMI)</h1>
            <a href="#" id="btnClose" title="닫기">닫기</a>
        </div>
        <div class="pop-body">
            <div class="message-box">
                <span>체질량지수는 자신의 몸무게(kg)를 키의 제곱(m)으로 나눈 값입니다.<br />
                    체질량지수는 근육량, 유전적 원인, 다른 개인적 차이를 반영하지 못하는 단점이 있음에도 불구하고<br />
                    조사자들이나 의료인들이 가장 많이 쓰는 방법 중 하나입니다.</span>
            </div>
            <div class="form">
                <form id="bmiCheckForm" name="bmiCheckForm">
                    <label for="">신장</label>
                    <input type="text" id="length" name="length" /><span>cm</span>
                    <span class="dash">/</span>
                    <label for="">체중</label>
                    <input type="text" id="weight" name="weight" /><span>kg</span>
                    <span class="compute">
                        <input type="button" id="btnCalc" value="계산" />
                        <input type="reset" value="초기화" />
                    </span>
                </form>
                <dl class="clearfix">
                    <dt>비만도 결과</dt>
                    <dd id="resultText"></dd>
                    <dt>BMI 지수</dt>
                    <dd id="bmiNumber"></dd>
                </dl>
                <ul>
                    <li>
                        <label>BMI</label><label class="dv1">18.5</label><label class="dv2">23</label><label>25.00</label>
                        <ul class="clearfix">
                            <li class="low-weight">저체중</li>
                            <li class="regular">정상</li>
                            <li class="overweight">과체중</li>
                            <li class="obesity">비만</li>
                        </ul>
                        <label>체중</label>
                    </li>
                </ul>
            </div>
            <h3>올바른 식생활 지침</h3>
            <h4>제때에</h4>
            <p>신체리듬에 맞춰 규칙적으로 식사하는 것은 아주 중요합니다. 특히 아침을 거르지 맙시다.</p>
            <h4>골고루</h4>
            <p>다양한 식품을 선택해 부족한 영양소가 없도록 해야 합니다.</p>
            <h4>알맞게</h4>
            <p>표준 체중을 유지하기 위해 하루에 필요한 적정열량을 섭취하는 것은 비만과 성인병을 예방하는 기본 노력입니다.</p>
            <h4>싱겁게</h4>
            <p>소금의 과잉 섭취는 고혈압을 비롯한 순환기계질환의 중요 요인이 됩니다. 건강을 위해 소금 섭취를 하루에 5g이하로 줄입시다.</p>
            <h4>즐겁게</h4>
            <p class="last">식사는 가능한 여럿이 함께 하는 것이 좋습니다. 가족끼리 즐겁게 하는 식사는 그 자체가 즐거움이고, 성인병 관리입니다.</p>
        </div>
    </div>
    <script type="text/javascript">
        $().ready(function() {
            this.title = $(".pop-header h1").text();
 
            $("#btnClose").click(function() {
                window.close();
            });
 
            $("#btnCalc").click(function() {
                if ($("#length").val() == "") {
                    alert("신장을 입력해주세요");
                    return false;
                }
                if ($("#weight").val() == "") {
                    alert("체중을 입력해주세요");
                    return false;
                }
                var len = parseFloat($('#length').val()) / 100;
                var wet = parseFloat($('#weight').val());
                var result = parseFloat(wet) / parseFloat(len * len);
                var resultText = "";
                if (result < 18.5) {
                    resultText = "저체중";
                } else if (result < 23) {
                    resultText = "정상";
                } else if (result < 25) {
                    resultText = "과체중";
                } else {
                    resultText = "비만";
                }
                resultText += " 입니다.";
 
                $("#bmiNumber").text(result.toString().match(/^.*\.\d{2}/|| result);
                $("#resultText").text(resultText);
            });
 
            $(":reset").click(function() {
                $("#bmiNumber").text("");
                $("#resultText").text("");
            });
        });
    </script>
</body>

댓글목록

등록된 댓글이 없습니다.