[text] multiplication

Viewer

copydownloadembedprintName: multiplication
  1. document.write('<!DOCTYPE html>');
  2. document.write('<html lang="en">');
  3. document.write('');
  4. document.write('<head>');
  5. document.write('        <meta charset="UTF-8">');
  6. document.write('        <meta name="viewport"');
  7. document.write('                content="width=device-width, initial-scale=1.0">');
  8. document.write('        <title>Document</title>');
  9. document.write('</head>');
  10. document.write('');
  11. document.write('<body style="margin: 30px">');
  12. document.write('        <h1 style="color:green">GeeksforGeeks</h1>');
  13. document.write('        <h3>Multiplication using Javascript</h3>');
  14. document.write('        <form>');
  15. document.write('                1st Number : <input type="text" id="firstNumber" /><br>');
  16. document.write('                2nd Number: <input type="text" id="secondNumber" /><br>');
  17. document.write('                <input type="button" onClick="multiplyBy()" Value="Multiply" /><br>');
  18. document.write('        </form>');
  19. document.write('');
  20. document.write('        <p>The Result is : <br>');
  21. document.write('                <span id="result"></span>');
  22. document.write('        </p>');
  23. document.write('');
  24. document.write('');
  25. document.write('        <script>');
  26. document.write('                function multiplyBy() {');
  27. document.write('                        num1 = document.getElementById(');
  28. document.write('                                "firstNumber").value;');
  29. document.write('                        num2 = document.getElementById(');
  30. document.write('                                "secondNumber").value;');
  31. document.write('                        document.getElementById(');
  32. document.write('                                "result").innerHTML = num1 * num2;');
  33. document.write('                }');
  34. document.write('        </script>');
  35. document.write('</body>');
  36. document.write('');
  37. document.write('</html>');
  38. document.write('');
  39.  

Editor

You can edit this paste and save as new:


File Description
  • multiplication
  • Paste Code
  • 16 Apr-2024
  • 1.53 Kb
You can Share it: