This line below gives a greeting depending on the time of the day.
The <h4 id="greeting">test</h4> is just like a normal header. But now it also has an ID-label.
And then you can manipulate the content of that header with the following commando:
document.getElementById("greating").innerHTML='your new text'
You can also put your script in a separate file. example 'main.js' and you call this script from within the html page with the following code:
On this site you will find other simple examples to take the first steps in programming. Even some computer games !!! See for example in this YouTube video:
Or the Corona Shooter Game in C# tutorial. You can play it here (free download) but also find the source code to program the game itself. Just by using other drawings, you can make another game. For example, a 2D space shooter.
How does this game look like? I made a short YouTube video. But again you can make a completely different game. Just by using other drawings.
Back to English Infonosity.net
Back to Computers en Elektronica (Dutch)