FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 363   



Demo

Code

<html>

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
    </script>
    <script>
        $(document).ready(function() {
            $("#btn").click(function() {
                var table = $("#table").val();
                console.log("printing table for " + table);
                var resultString = "";

                for (i = 1; i <= 10; i++) {
                    resultString = resultString + (table + "*" + i + "=" + table * i + "</br>");
                }
                $("#result").html(resultString);
            });
        });
    </script>
</head>

<body>
    Enter a number : <input type="text" name="number" id="table"><br><br>
    <button id="btn"> submit </button>
    <br>
    <p id="result"></p>
</body>

</html>



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News