INTRODUCTION TO JAVSCRIPT
PART 2 (OK)
Interaction
In the first part of this guide, you learned
how to use JavaScript, how to write code
and how to see if it actually works.
But that
was all just basic stuff - in this second part
we ll show you what...
More
INTRODUCTION TO JAVSCRIPT
PART 2 (OK)
Interaction
In the first part of this guide, you learned
how to use JavaScript, how to write code
and how to see if it actually works.
But that
was all just basic stuff - in this second part
we ll show you what JavaScript is really
used for in the real world and where it can
really make a difference.
Accessing page elements
As we ve said before, JavaScript is primarily
used for adding dynamic effects and user
interactivity to your Web pages.
One of the
most important functions of JavaScript is to
be able to access any element on the page.
You can do this by creating a variable that
represents that element.
Then when you
change the value of the variable, you are
actually making changes to the element.
For example, if you want to check the text
that a user has entered into a textbox, you
need to access the textbox through code
and programmatically check its contents.
You can also hide and reveal elements on
the page, or animate the text in the
Less