Hello Friends, In this article I will create a game for all of you. This is a simple game and many of us play it in our free time. Name of the game is Tic Tac toe. And it is used as school or college assignment or project . I have created the tic tac toe game using HTML JavaScript and CSS.
[Read more…] about Simple tic tac toe game using HTML JavaScript and CSSHTML
Sample HTML and CSS for starting web application
Many times I want to try out some thing new with HTML, CSS and jquery. But as soon as I start out doing some set up for my experiments for all of the three, it takes me lot of time to do the set up and have some initial UI on which I can do some experiments. That is why I have created a simple html page with basic layout on which I can play around in my free time. [Read more…] about Sample HTML and CSS for starting web application
How to add JavaScript code to the HTML page
This is a very basic article for the beginners, to let the developer know where in the HTML we should place the JavaScript code. While writing the JavaScript as a beginner programmer, most of the time developer doesn’t know where to write the JavaScript code and they spend too much time looking for the solution for it.
JavaScript Code
The JavaScript code is usually enclosed in the script tag in the HTML page. as shown below
<script> var myVar = "Hello World"; alert(myVar); </script>
In the above example I have created a JavaScript code snippet where I have declared a variable named myVar and shown it in the alert which will in turn display a message box when we load the HTML page.
We can place this script based on the need, about when do we want to execute this code. If we want to execute this code before loading the whole of the HTML of the web page in that case this code should be placed in the
section of the HTML page as shown below code.<html lang="en"> <head> <script> var myVar = "Hello World"; alert(myVar); </script> <title>Page Title</title> </head> <body> <p>This is the web page</p>