Sunday, 22 November 2015

forloop in Java

<html>
<body>
<script type="text/javascript">
for (i = 0; i <= 5; i++)
{
document.write("The number is" + i);
document.write("<br />");
}

</script>



This is what it should look like when the code has been implemented





Friday, 13 November 2015

HTML hrefs

<html>
<body>
<p><a href="http:gmit.ie">Look it up!</a></p>
</body>
















When finished it should look like this



Headings in HTML

<html>
<body>

<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h4>This is a heading</h4>
</body>

















This is what it should look like when completed


How to make a variable in java

<html>
<body>
<script tyoe="text/javascript">
var firstname;
firstname="Edmund";
document.write(firstname);
document.write("<br/>");
firstname="Tom";
document.write("<br/>");
document.write(firstname);

</script>
















When you put it in, should look like this

How to use an external java script

HTML:

<html>
<body>
<script src="hello.js">
</script>
















JAVA:

alert("Hello World")
















When completed. it should look like this

Put in java script in a html page

<html>
<body>
<script ="text/javascript>
document.write("Hello World");
</script>
</body>
</html>



















When it runs it should look like this