fork download
  1. <!DOCTYPE html>
  2. <html lang="th">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>เครื่องคิดเลข</title>
  7. <link rel="stylesheet" href="style.css">
  8. </head>
  9. <body>
  10. <div class="calculator">
  11. <input type="text" id="display" disabled>
  12. <div class="buttons">
  13. <button onclick="clearDisplay()">C</button>
  14. <button onclick="appendToDisplay('7')">7</button>
  15. <button onclick="appendToDisplay('8')">8</button>
  16. <button onclick="appendToDisplay('9')">9</button>
  17. <button onclick="appendToDisplay('/')">/</button>
  18.  
  19. <button onclick="appendToDisplay('4')">4</button>
  20. <button onclick="appendToDisplay('5')">5</button>
  21. <button onclick="appendToDisplay('6')">6</button>
  22. <button onclick="appendToDisplay('*')">*</button>
  23.  
  24. <button onclick="appendToDisplay('1')">1</button>
  25. <button onclick="appendToDisplay('2')">2</button>
  26. <button onclick="appendToDisplay('3')">3</button>
  27. <button onclick="appendToDisplay('-')">-</button>
  28.  
  29. <button onclick="appendToDisplay('0')">0</button>
  30. <button onclick="appendToDisplay('.')">.</button>
  31. <button onclick="calculateResult()">=</button>
  32. <button onclick="appendToDisplay('+')">+</button>
  33. </div>
  34. </div>
  35. <script src="script.js"></script>
  36. </body>
  37. </html>
  38.  
Success #stdin #stdout 0.04s 25908KB
stdin
Standard input is empty
stdout
<!DOCTYPE html>
<html lang="th">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>เครื่องคิดเลข</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="calculator">
        <input type="text" id="display" disabled>
        <div class="buttons">
            <button onclick="clearDisplay()">C</button>
            <button onclick="appendToDisplay('7')">7</button>
            <button onclick="appendToDisplay('8')">8</button>
            <button onclick="appendToDisplay('9')">9</button>
            <button onclick="appendToDisplay('/')">/</button>
            
            <button onclick="appendToDisplay('4')">4</button>
            <button onclick="appendToDisplay('5')">5</button>
            <button onclick="appendToDisplay('6')">6</button>
            <button onclick="appendToDisplay('*')">*</button>

            <button onclick="appendToDisplay('1')">1</button>
            <button onclick="appendToDisplay('2')">2</button>
            <button onclick="appendToDisplay('3')">3</button>
            <button onclick="appendToDisplay('-')">-</button>

            <button onclick="appendToDisplay('0')">0</button>
            <button onclick="appendToDisplay('.')">.</button>
            <button onclick="calculateResult()">=</button>
            <button onclick="appendToDisplay('+')">+</button>
        </div>
    </div>
    <script src="script.js"></script>
</body>
</html>