Quarter 3 Week 1 .Net2 Module Javascript PDF
Quarter 3 Week 1 .Net2 Module Javascript PDF
Quarter 3 Week 1 .Net2 Module Javascript PDF
JavaScript
Competency
Create static pages using new
features available in HTML5
What is JavaScript
JavaScript is a dynamic computer programming language.
It is lightweight and most commonly used as a part of web pages,
whose implementations allow client-side script to interact with the
Will you appear
user and make
in the dynamic pages.
video?
It is an
Whatinterpreted
will your programming language with object-oriented
surroundings
capabilities. be?
Microsoft FrontPage
Macromedia
Dreamweaver MX
Macromedia HomeSite 5
JavaScript - Syntax
JavaScript can be implemented using
JavaScript statements that are placed
within the <script>... </script> HTML tags
in a web page.
You can place the <script> tags,
containing your JavaScript, anywhere
within your web page, but it is normally
recommended that you should keep it
within the <head> tags.
JavaScript - Syntax
<script ...>
JavaScript code
</script>
Two important attributes of
the script tag
Language − This attribute specifies
what scripting language you are
using. Typically, its value will be
javascript.
Type− This attribute specifies what
scripting language you are using.
Typically, its value will be
javascript.
First JavaScript Code
<html>
<body>
<script language = "javascript" type =
"text/javascript">
<!--
document.write("Hello World!")
//-->
</script>
</body>
</html>This code will produce the following result
Sample JavaScript Code
<html>
<body>
<p>In this case JavaScript changes the value of the src (source)
attribute of an image.</p>
<button
onclick="document.getElementById('myImage').src='pic_bulbon.gif'">
Turn on the light</button>
Con"t. Sample JavaScript Code
<button
onclick="document.getElementById('myImage').src='pic_bulboff.gif'"
>Turn off the light</button>
</body>
</html>
activity 1