편집 기록

편집 기록
  • 프로필 엽토군님의 편집
    날짜2019.11.01

    html+css+java질문좀부탁드립니다.


    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width">
        <title>자동견적시스템</title>
        <link href="style.css" rel="stylesheet" type="text/css" />
      </head>
      <style type ="text/css">
      .title{
        height:100px;
        border-bottom:2px solid black;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
      }
      .prodName{
        display: inline-block;
        margin-right: 10px;
        font-family: "Noto Sans Bold";
        font-size: 42px;
        color: #222;
        line-height: 100%;
      }
      .tit0{
        float: left;
        position: relative;
        margin-top: 10px;
        margin-left: 10px;
        line-height:2.3em;
      }
    /*테이블 셋팅*/
    table.type02 {
        border-collapse: separate;
        border-spacing: 0;
        text-align: left;
        line-height: 1.5;
        border-top: 1px solid #ccc;
        border-left: 1px solid #ccc;
      margin : 20px 10px;
    }
    table.type02 th {
        width: 150px;
        padding: 10px;
        font-weight: bold;
        vertical-align: top;
        border-right: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
        border-top: 1px solid #fff;
        border-left: 1px solid #fff;
        background: #eee;
        text-align: center;/*택스트중앙*/
    }
    table.type02 td {
        width: 150px;
        padding: 10px;
        vertical-align: top;
        border-right: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
        text-align: center;
    }
      </style>
      <script>
    function multiplyBy()
    {
            num1 = document.getElementById("firstNumber").value;
            num2 = document.getElementById("secondNumber").value;
            document.getElementById("result").innerHTML = num1 * num2;
            document.getElementById("result2").innerHTML = num1 * num2;
    
            /*곱*/
            num3 = document.getElementById("result1").value;
            document.getElementById("result3").innerHTML = num3 * num1 * num2;
    
    }
        </script>
      <body>
        <div class="title">
          <h3 class="prodName" id="subTitleProdNm">견적서</h3>     
        </div>
        <div class="tit0">
                            <h4>종류 선택</h4>
                   <form>
                    칸수 <input type="number" id="firstNumber"/><br> 줄수 <input type="number" id="secondNumber"/><br>
                    <input type="button" onClick="multiplyBy()" Value="합계" /> = 
                   <span id ="result"> 결과값 </span>
                    </form>
    <table class="type02">
        <tr>
            <th scope="col">품명</th>
            <th scope="col">가격</th>
            <th scope="col">수량</th>
            <th scope="col">합계</th>
        </tr>
        <tr>
          <th scope="row"> 사과</th>
          <td id="result1">500</td>
          <td id="result2"></td>
          <td id="result3"></td>
    </table>
                    </div>
    
    
    
      </body>
    </html>
    
    
    
    

    칸수 * 줄수 하면 합계가나오고

    가격 X 수량 = 합계 가 되어야되는데

    가격 500이 정수가아닌지 곱샘이 안되는데

          <td id="result1">500</td> 
    
    num3 = document.getElementById("result1").value;
    

    이거 어떻게 처리하면 될까요?

  • 프로필 알 수 없는 사용자님의 편집
    날짜2019.11.01

    html+css+java질문좀부탁드립니다.


    //<!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width">
        <title>자동견적시스템</title>
        <link href="style.css" rel="stylesheet" type="text/css" />
      </head>
      <style type ="text/css">
      .title{
        height:100px;
        border-bottom:2px solid black;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
      }
      .prodName{
        display: inline-block;
        margin-right: 10px;
        font-family: "Noto Sans Bold";
        font-size: 42px;
        color: #222;
        line-height: 100%;
      }
      .tit0{
        float: left;
        position: relative;
        margin-top: 10px;
        margin-left: 10px;
        line-height:2.3em;
      }
    /*테이블 셋팅*/
    table.type02 {
        border-collapse: separate;
        border-spacing: 0;
        text-align: left;
        line-height: 1.5;
        border-top: 1px solid #ccc;
        border-left: 1px solid #ccc;
      margin : 20px 10px;
    }
    table.type02 th {
        width: 150px;
        padding: 10px;
        font-weight: bold;
        vertical-align: top;
        border-right: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
        border-top: 1px solid #fff;
        border-left: 1px solid #fff;
        background: #eee;
        text-align: center;/*택스트중앙*/
    }
    table.type02 td {
        width: 150px;
        padding: 10px;
        vertical-align: top;
        border-right: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
        text-align: center;
    }
      </style>
      <script>
    function multiplyBy()
    {
            num1 = document.getElementById("firstNumber").value;
            num2 = document.getElementById("secondNumber").value;
            document.getElementById("result").innerHTML = num1 * num2;
            document.getElementById("result2").innerHTML = num1 * num2;
    
            /*곱*/
            num3 = document.getElementById("result1").value;
            document.getElementById("result3").innerHTML = num3 * num1 * num2;
    
    }
        </script>
      <body>
        <div class="title">
          <h3 class="prodName" id="subTitleProdNm">견적서</h3>     
        </div>
        <div class="tit0">
                            <h4>종류 선택</h4>
                   <form>
                    칸수 <input type="number" id="firstNumber"/><br> 줄수 <input type="number" id="secondNumber"/><br>
                    <input type="button" onClick="multiplyBy()" Value="합계" /> = 
                   <span id ="result"> 결과값 </span>
                    </form>
    <table class="type02">
        <tr>
            <th scope="col">품명</th>
            <th scope="col">가격</th>
            <th scope="col">수량</th>
            <th scope="col">합계</th>
        </tr>
        <tr>
          <th scope="row"> 사과</th>
          <td id="result1">500</td>
          <td id="result2"></td>
          <td id="result3"></td>
    </table>
                    </div>
    
    
    
      </body>
    </html>
    
    
    
    

    칸수 * 줄수 하면 합계가나오고

    가격 X 수량 = 합계 가 되어야되는데

    가격 500이 정수가아닌지 곱샘이 안되는데

      <td id="result1">500</td> 
    

    num3 = document.getElementById("result1").value;

    이거 어떻게 처리하면 될까요?