Showing posts with label Custom html code. Show all posts

How to add JavaScript into HTML page

Just open a HTML file with any html editor software or notepad. You can use Notepad ++ for batter result. JavaScripts in HTML must be inserted between <script> and </script> tags.

JavaScripts can be put in the <body> and in the <head> section of an HTML page. To insert a JavaScript into an HTML page, use the <script> tag.
The <script> and </script> tells where the JavaScript starts and ends.
The lines between the <script> and </script> contain the JavaScript from the below  box:




<html><head><title>My Page</title>
<script language="javascript" type="text/javascript">
function myFunction() {
          alert('Hello world');
}
</script>
</head>
<body>
<a href="javascript:myFunction();">Click here</a>
</body>
</html>


Since the head loads before the body, placing code in the head ensures that it is available when needed. For example, the following code will work once the page has completely loaded, but if a user manages to click the link before the function has loaded they will get an error. This can easily become an issue if the page is large or slow to load.

<html><head><title>My Page</title>

</head>
<body>
<a href="javascript:myFunction();">Click here</a>
<script language="javascript" type="text/javascript">
function myFunction() {
                alert('Hello world');
}
</script>
</body>
</html>

Note: JavaScript can cause problems when used in tables. It may help to use JavaScript to create the entire table, or at least whole rows.
Read more

Animated live Clock widget generator for blog or website

Time and tide wait for none. It is true like you and I. We can not prove it as wrong. So time is most impenitent for us. Some nice clock are below for you. It can help you manage your valuable time. All are free and add free with your blog and website. Very simple installation and live demo are keep on below. Do not wait lets go for take this by following below instruction.




Read more