Get started with jcalculator CDN

licensed

JCalculator is a library for performing complex mathematical calculations.

Tags:
  • calculator
  • jquery
  • input

Stable version

Copied!

How to start using jcalculator CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with jcalculator CDN - cdnhub.io</title>
    <script src="https://cdn.cdnhub.io/jcalculator/1403955268/jcalculator.min.js"></script>
</head>
<body>
    <input type="text" id="num1" placeholder="Enter first number">
    <input type="text" id="num2" placeholder="Enter second number">
    <button onclick="calculate()">Calculate</button>
    <p id="result"></p>

    <script>
        function calculate() {
            const num1 = document.getElementById('num1').value;
            const num2 = document.getElementById('num2').value;
            const calculator = new jCalculator();
            const result = calculator.add(parseFloat(num1), parseFloat(num2));
            document.getElementById('result').innerText = result;
        }
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!

All versions