### **Code for the USA to India Calculator** #### 1. **HTML (index.html)** ```html USA to India Calculator

USA to India Calculator

Convert US Dollars (USD) to Indian Rupees (INR)

``` --- #### 2. **CSS (styles.css)** ```css /* General Styles */ body { font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #003366, #ffffff, #ff9933); /* USA and India theme */ } .container { background-color: #ffffff; padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); text-align: center; } h1 { color: #003366; /* USA blue */ } p { color: #666; } .calculator { margin-top: 20px; } .input-group { margin-bottom: 15px; } label { display: block; margin-bottom: 5px; color: #333; } input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; } button { background-color: #003366; /* USA blue */ color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; } button:hover { background-color: #002244; } .result { margin-top: 20px; } #result-text { color: #ff9933; /* Indian saffron */ } ``` --- #### 3. **JavaScript (script.js)** ```javascript // Conversion rate (1 USD to INR) const usdToInrRate = 82.5; // Example rate, update with real-time data function convertUSDToINR() { const usdAmount = parseFloat(document.getElementById("usd").value); if (isNaN(usdAmount)) { alert("Please enter a valid amount in USD."); return; } const inrAmount = (usdAmount * usdToInrRate).toFixed(2); document.getElementById("result-text").innerText = `${usdAmount} USD = ${inrAmount} INR`; } ```

Comments

Popular posts from this blog

cryptocurrency pi network