Hello! Though this forum section seems to be somewhat dead, I'll try nevertheless (last post made on 5th September. Thought that peole have questions every day :D).
So we started learning basic HTML and scripts, and our homework was to make a really easy calculator (though if people wanted, they could make sophisticated calculators too, if they're able to). Well, and I made a calculator which will calculate the price of gas.
Here's the code:
Here's the output:
Now what I wanted to do, is to get this text form to work with by pressing "Enter". At the moment the function will only work if I press the "Enter" button on the page with my cursor, or I'll use the "Tab" button and then press "Enter" on the keyboard.
I'm sure we will learn about this in the future, but I'm wondering if this is very difficult or not. Of course I did a Google search about it, but I'm not sure how I should edit my code, or where should I paste the code, to get it to work.
One thing that would be also cool to get to work is rounding the answers. Say that I want to buy 10 litres of gas, that's 13.819999999999999 euros (10x1.382). It'd be cool if it'd round it to 13.82. But that could be a difficult thing for a beginner.. because I'm just starting with all this.