알바비 월급을 계산해주는 스크립트

알바비 월급을 계산해주는 스크립트

다온아빠 0 12244

알바 월급 계산기 아르바이트 월급 계산기

 

<style>
        #pricecal label {
            display: inline-block;
            width: 80px;
        }
      
        #pricecal input[type~=text] {
            width: 200px;
            height: 25px;
        }
      
        #calbt {
            width: 281px;
            height: 80px;
            margin-top: 15px;
            text-align: center;
            font-size: 18px;
            font-weight: 900;
            background: #f3bb4a;
            border: 1px solid #c4912a;
            border-radius: 5px;
            color: #6f5534;
        }
      
        #resoltdv {
            width: 281px;
            height: 200px;
            border: 1px solid gray;
        }
    </style>
    <form name="pricecal" id="pricecal">
        <p>
            <label for="price">시급 :</label>
            <input type="text" id="price"> </p>
        <p>
            <label for="wday">일한날짜 :</label>
            <input type="text" id="wday"> </p>
        <p>
            <label for="wtime">일한시간 :</label>
            <input type="text" id="wtime"> </p>
        <p>
            <label for="rtime">휴게시간 :</label>
            <input type="text" id="rtime"> </p>
        <p>
            <button onclick="cal(); return false;" id="calbt">계산하기</button>
        </p>
        <div id="resoltdv"></div>
    </form>
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function cal() {
            var price = $("#price").val();
            var wday = $("#wday").val();
            var wtime = $("#wtime").val();
            var rtime = $("#rtime").val();
            var resoltdv;
            var allprice = price * wtime; //총급여
            var goprice = allprice * 0.0065; //고용보험
            var soprice = allprice * 0.1; //수습
            var huprice = rtime * price; //휴계시간
            resoltdv = "총급여 : " + allprice + "</br>";
            resoltdv += "고용보험 : -" + goprice + "</br>";
            resoltdv += "수습기간 : -" + soprice + "</br>";
            resoltdv += "휴계시간 : -" + huprice + "</br>";
            $("#resoltdv").html(resoltdv);
        }
    </script> 

 

다온네 태그연습장에서 테스트 가능합니다.

위 소스를 복사후

<body> </body> 어 넣습니다.





0 Comments