05-27-2019, 12:38 PM
(This post was last modified: 09-01-2022, 01:08 AM by Fearless Community. Edited 3 times in total.
Edit Reason: Fixed Encoding
)
(05-27-2019, 12:10 PM)Arny Wrote: Maybe this?
Code:document.getElementsByName('name').value;
Code:
<html>
<form>
<input name="numb" type="number">
<button onclick="getValue()">run</button>
</form>
<script>
function getValue() {
var x = document.getElementsByName("numb")[0].tagName;
document.getElementById('show').innerHTML = x;
getStories()
}
var height
var storySize = 2.8
var getStories = function(storyCount){
storyCount = height / storySize
console.log("The height of the building is " + height + "m")
console.log("The building has " + Math.trunc(storyCount) + " stories")
console.log("the height of each story is " + storySize +"m")
}
</script>
<p id="show"></p>
</body>
</html>
I've tried this now