Let's learn Javascript together! (level 1)
programming·@thealexandru·
0.000 HBDLet's learn Javascript together! (level 1)
<html> <p><br></p> <p><em>Hi everyone, let me introduce my self, my name is Alex, I am studying Javascript right now, and I decided to share my homework with you, maybe you are at the beginning too or you just want to practice, so hope it will help you too.</em></p> <p><em>I will post condition, and a photo of how the result should look like, below that will be the working code so if you will have trouble and want to look how to do it, you will see the result there. </em></p> <p><em>The practice is very important, of course theory is important too but without regular practice you will start to forget what you studied. Practicing daily with new challenges will help you a lot in your future maybe bigger projects.</em></p> <p><em>So let's begin, good luck!</em></p> <blockquote><strong>Level 1, exercice nr 1 - Show temperature-termometer:</strong></blockquote> <p>In this exercise should be used the <a href="https://www.w3schools.com/jsref/met_win_alert.asp">"getElementById"</a> method, <a href="https://www.w3schools.com/jsref/jsref_trim_string.asp">attributes ".style" and ".value".</a></p> <p>The following files are given:</p> <p><strong>termometer.html</strong><code><em><br> </em></code><img src="https://i.imgur.com/Z19kk78.png" width="732" height="600"/></p> <p><br></p> <p><strong>termometer.js</strong></p> <p>//<strong>What you have to do:</strong><br> <code> // * Find "temperature-input"<br> // * Find the div "termometer-indicator"<br> // * To read input temperature value<br> // * To check if value is between -20..+50 degrees C<br> // * To assign the .style.height property to the thermometer indicator so that each degree increases the width by 3px</code></p> <p><br></p> <p><code>The result should look like this:</code></p> <p><img src="https://github.com/dorinesinenco/training/blob/master/ro/JS/easy/DOM/html/termometer.png?raw=true" width="240" height="57"/></p> <p><strong>In the comments below you can find my method how I resolve it. Write your method too.</strong></p> <p><br></p> </html>