Total members 11893 |It is currently Tue Nov 05, 2024 11:39 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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>





Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time

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

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

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


Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time

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


Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time

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 ?


Author:
Newbie
User avatar Posts: 3
Have thanks: 0 time

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:


Author:
Newbie
User avatar Posts: 27
Have thanks: 1 time

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
}



Author:
Newbie
User avatar Posts: 5
Have thanks: 0 time
Post new topic Reply to topic  [ 7 posts ] 

  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     -  
 H1 H2 H3 H4 H4 H5 H6 heading html tags     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com