Lesson 1: Javascript Learn here!

Do you want to learn javascript (js)?
That is the reason why i have been away from the forum for so long!

Write onto the document:

<script type="text/javascript" language=javascript>
document.write("hi!")
</script>

this comes with the output:


hi!

Make a function:

<script type="text/javascript" language=javascript>
function hi(){
document.write("hi!")
}
</script>

You have to push a button, or have a link call the function:

<html>
<body>
<input type="button" onclick="hi()" />
</body>
</html>

,or


<html>
<body>
<a href="#" onclick="hi()">
</body>
</html>

The result after clicking the button is this:


hi!

Are you taking a class or teaching yourself?

Html has objects, that can be edited. javascript can change those attributes with a Event (onclick, onblur, onchange, ect.)

Event changing backround color:

<script type="text/javascript">
function clickedz(){
document.bgcolor = "Red" ;
}
</script>
<html>
<body>
<input type=button value="Press to display 'hi!'" onclick="javascript: clickedz()" />
</body>
</html>

I am teaching myself, And i have made a whole page using js. My site. is the js.

Also, because this is a teaching topic, I request you post on another thread called: ~Javascript L H Comments~


<html>
<body>
<script type="text/javascript">
var d = newdate()
var time = d.getHours()

if (time < 10)
{
document.write("<b>Good Morning!</b>")
}
else
{
document.write("<b>Good Day!</b>")
}
</script>
</body>
</html>

That will display on your page:

Good Morning

If the time is before 10 o’ clock

or

Good Day

If the time is after 10 o’ clock

I’m just learning on http://www.w3schools.com

i have learned the basics of javascript but could not find a website i liked that contained a full tutorial, how much are you actually going to post?

a tutorial of javascript is on that website i mentioned, but my main goal here is to develop apps for the iPhone. I’ve got a long way to go.

Okay, here are some websites for Js:

http://javascript.internet.com Applications of Javascript
http://w3schools.com/js/ Javascript tutorials

and also:

[http://w3schools.com/ for more cool tutorials! :cool:](http://w3schools.com/ for more cool tutorials! :cool:)