VA to amps Calculator Using JavaScript HTML With Example

Hello Friends Today, through this tutorial, I will tell you How to Write Program Voltage to Amperes (VA to Amps) calculator using PHP with HTML? Sure! Below is a simple HTML and JavaScript code to create a Voltage to Amperes (VA to Amps) calculator:

index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>VA to Amps Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
}
label {
font-weight: bold;
}
input[type="number"] {
width: 100px;
padding: 5px;
margin-bottom: 10px;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<h2>VA to Amps Calculator</h2>
<label for="voltage">Enter Voltage (V):</label>
<input type="number" id="voltage">
<br>
<label for="power">Enter Power (VA):</label>
<input type="number" id="power">
<br>
<button onclick="calculateAmps()">Calculate</button>
<p id="result"></p>
<script>
function calculateAmps() {
var voltage = parseFloat(document.getElementById("voltage").value);
var power = parseFloat(document.getElementById("power").value);
if (!isNaN(voltage) && !isNaN(power)) {
var amps = power / voltage;
document.getElementById("result").innerText = "Current (Amps): " + amps.toFixed(2);
} else {
document.getElementById("result").innerText = "Please enter valid numbers.";
}
}
</script>
</body>
</html>

This code creates a simple web page with input fields for voltage and power in VA (Volt-Amperes). When you click the “Calculate” button, it computes the current in Amperes (Amps) using the provided voltage and power values. The result is displayed below the button.

Example:-

VA to Amps Calculator



Cialis (Tadalafil) är den främsta konkurrenten till Viagra (Sildenafil) på marknaden för erektil dysfunktion. köpa Cialis i Sverige föredras av många på grund av sin längre varaktighet och anses vara det mest kostnadseffektiva varumärkesbaserade ED-läkemedlet som finns tillgängligt i Sverige. Cialis finns i två varianter: Cialis och Cialis Daily, och fyra olika doseringar: 2,5 mg, 5 mg, 10 mg och 20 mg, erbjuder Cialis också en rad olika alternativ för att passa patientens behov.