Thread: javascript and html
Threaded View
-
12-10-08, 08:31 #9
There are two ways you can javascript in to HTML.
1. Write .js file and write all the java script function and call the function from your html files.
2. You can write java script in your own HTML files itself.This is difficult to maintain if HTML file is big.
eg
<html>
<head>
<script>
function MyFunction()
{
alert("Hello World!");
}
</script>
</head>
<body>
<form>
<input type="button" value="Click me!"
onclick="MyFunction()" >
</form>
</body>
</html>
the above simple example when you click the Click me buttion you will see alert of the Hello World
Similar Threads
-
What is HTML?
By lennondevid in forum Website DesignReplies: 6Last Post: 27-02-16, 07:21 -
Jsp vs html - which one u use.. ?
By paramita0101 in forum Webmaster newbie helpReplies: 10Last Post: 27-08-12, 11:26 -
Can I learn javascript and php indepth from internet?
By lemon_1800 in forum ScriptsReplies: 28Last Post: 14-06-09, 09:03 -
Is it safe to put javascript to our site?
By alec11 in forum ScriptsReplies: 20Last Post: 04-03-09, 19:53 -
need help with html
By cj monaco in forum Website DesignReplies: 14Last Post: 12-10-08, 19:18
Bookmarks