Hello friends, today I will tell you through experts php tutorial how you can create converter tool calculate feet to cm length. So let’s try to understand step to step with example.
Here is the javascript code for the feet to cm Length converter.
<script>
function LengthConverter(valNum) {
document.getElementById("getcm").innerHTML=valNum/0.032808;
}
</script>
Here is the html code with javascript for the feet to cm length converter.
feet-to-cm.html
<!DOCTYPE html>
<html>
<title>Feet to cm Length Converter</title>
<body>
<h2>Length Converter</h2>
<p>Type a value in the Feet field to convert the value to cm:</p>
<p>
<label>Feet</label>
<input id="inputFeet" type="number" placeholder="Feet" oninput="LengthConverter(this.value)" onchange="LengthConverter(this.value)">
</p>
<p>cm: <span id="getcm"></span></p>
<script>
function LengthConverter(valNum) {
document.getElementById("getcm").innerHTML=valNum/0.032808;
}
</script>
</body>
</html>
Length Converter
Type a value in the Feet field to convert the value to cm:
cm: