interest rate calculator html code -free html code -free html code with java script - Interest rate calculator free html code

We will try to give you a new code for every day . 
You can create your tool website and earn unlimited with google and google adsense. 
You can create your free website with the google product name as Blogger. 
You just open Blogger.com 
create your account and write or paste this code in the html view of your blogger. 

so the Code is given below you can copy and paste in your website . 

Here is a code for simple and compounded rate calculator   

 





<html>

<head>

    <title>Interest Rate Calculator</title>

    <style>

        .container {

            max-width: 400px;

            margin: 0 auto;

            padding: 20px;

            border: 1px solid #ccc;

            border-radius: 4px;

        }


        .form-group {

            margin-bottom: 10px;

        }


        .form-group label {

            display: block;

            font-weight: bold;

        }


        .form-group input {

            width: 100%;

            padding: 5px;

            border: 1px solid #ccc;

            border-radius: 4px;

        }


        .result {

            margin-top: 20px;

            font-weight: bold;

        }

    </style>

</head>

<body>

    <div class="container">

        <h2>Interest Rate Calculator</h2>

        <div class="form-group">

            <label>Principal Amount:</label>

            <input id="principalAmount" placeholder="Principal amount" type="number" />

        </div>

        <div class="form-group">

            <label>Interest Earned:</label>

            <input id="interestEarned" placeholder="Interest earned" type="number" />

        </div>

        <div class="form-group">

            <label>Time Period (in years):</label>

            <input id="timePeriod" placeholder="Time period in years" type="number" />

        </div>

        <button onclick="calculateInterestRate()">Calculate Interest Rate</button>

        <div class="result" id="interestRateResult"></div>

    </div>


    <script>

        function calculateInterestRate() {

            var principalAmount = parseFloat(document.getElementById('principalAmount').value);

            var interestEarned = parseFloat(document.getElementById('interestEarned').value);

            var timePeriod = parseInt(document.getElementById('timePeriod').value);


            if (isNaN(principalAmount) || isNaN(interestEarned) || isNaN(timePeriod)) {

                document.getElementById('interestRateResult').innerHTML = 'Please enter valid inputs.';

                return;

            }


            var interestRate = (interestEarned / (principalAmount * timePeriod)) * 100;

            interestRate = interestRate.toFixed(2);


            document.getElementById('interestRateResult').innerHTML = 'Interest Rate: ' + interestRate + '%';

        }

    </script>

</body>

Comments

Popular posts from this blog

बस माल पैक करो और कंपनी को वापस कर दो और 60 हजार रुपए महीना कमाओ, bindi packing business

घर बैठे करे पैकिंग का काम कमाए लाखो रूपये महीना , पॉपकॉर्न कंपनी दे रही है मौका

3 ONLINE EARNING APP , NO CONDITION , NO INVESTMENT , ONLY EARNING , घर बैठे पैसा कमाने के लिए 3 सबसे बढ़िया APP .