How To Insert Javascript Code Into HTML Pages
how to insert javascript code into html pages
how, to, insert, javascript, code, into, html, pages
How To Insert Javascript Code Into HTML Pages
Post Description: how to insert javascript code into html pages
POST# 1196
Posted On: Sat Apr 19, 2008 7:09 pm
web hosting
Topic: How To Insert Javascript Code Into HTML Pages
the first thing you will need a HTML document for your script, here is a blank html document, this is the defaults tags you will need to use.

HTML TEMPLATE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Webune Javascript Tutorial</title>
</head>

<body>

</body>
</html>


now that you have a plain html document we can use this template to insert our javascript


now lets create a file called
step 1. open your text editor (like notepad if you have windows)

step 2. copy and paste the following code into a blank notepad
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Webune Javascript Tutorial</title>
</head>

<body>
<B>This is part of the HTML document!</B>
<P>
<SCRIPT language="JavaScript">
<!--
document.write("This is from Javascript Code!");
//-->
</SCRIPT>
<P>
<B>Now back to the part of the HTML document!</B>
</body>
</html>


step3. save this file aswebune-javascript.html and open it with your web browser. you should see a single like of text that was written with Javascript

now when you open this file with your browser it will look like this:


Sat Apr 19, 2008 7:10 pm
1
hostman
Reply #1910

DEMO


This is part of the HTML document!

Now back to the part of the HTML document!

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload
     
  1. Putting Javascript In An HTML File
  2. Where Do You Put Javascript Code? HEAD OR BODY?
  3. How To Use The HTML SCRIPT Tags In Javascript
  4. How To Attached External Javascript Scripts
  5. How To Hide Javascript Code From Older Browsers
  6. How To Create Your First Javascript Web Page
  7. How To Insert Javascript Code Into HTML Pages
  8. How To Display Or Show Text On Html Using Javascript Document.write()