Switch to full style
HTML,DHTML,Javascript,XML,CSS
Post a reply

How to use HTML with JavaScript

Sat Oct 18, 2008 8:32 am

Following is the simple code that shows How to use HTML with JavaScript

Code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
function Message_Box (text) {
alert (text) }
// - End of JavaScript - -->
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT NAME="name" TYPE=Text>
<INPUT NAME="submit" TYPE=Button VALUE="Click Me" onClick="Message_Box(form.name.value)">
</FORM>
</BODY>
</HTML>




Re: How to use HTML with JavaScript

Sun Oct 19, 2008 10:29 am

thank you , keep on please :grin: :grin:

Re: How to use HTML with JavaScript

Thu May 14, 2009 5:03 pm

Nice comment! Also you can make a js file and include it in your HTML.

Re: How to use HTML with JavaScript

Sun Jul 12, 2009 7:33 pm

If you're having problem about "how to use javascript in HTML page you can visit here, to those interested click here

Re: How to use HTML with JavaScript

Wed Jul 22, 2009 11:44 am

That is a good information,I just wanted to know that JavaScript is a client side script,can we use or embed in a PHP script ?

Re: How to use HTML with JavaScript

Wed Sep 22, 2010 12:10 pm

Just by defining <SCRIPT LANGUAGE="JavaScript"> we can continue with the coding of HTML.
It is really beneficial to reduce errors...
thanx for the post.... :gOOd:

Re: How to use HTML with JavaScript

Fri Jun 17, 2011 1:39 pm

Example for JavaScript DisplayMessage () function

How to Display Hello World! (By HTML/Javascript)

Code:
<html>
<head>
<script language="javascript">
<!--Define a display function-->
function displaymessage()
{
alert("Hello World!");
}
<!--End of Display function-->
</script>
</head>

<body>
<form>
<input type="button" value="Click me!" onclick="displaymessage()" />
</form>
</body>
</html>


General syntax to define a function

Code:
function functionname(var1,var2,...,varX)
{
some code
}


Post a reply
  Related Posts  to : How to use HTML with JavaScript
 Hide HTML Div using JavaScript     -  
 cotact us html and javascript form     -  
 What are PHP,PSD to HTML ?     -  
 del html tag usage     -  
 Usage of xmp html tag     -  
 HTML Tags -2     -  
 dfn html tag usage     -  
 HTML Editor     -  
 I need help with a html code     -  
 start a new line in html     -