How do you javascript?

Answer:
Before you program in javascript you must learn HTML and know how to use it without Dream-weaver or any other similar programs. But lets say you have this prerequisite.

You now have two options you can either embed the Javascript anywhere in your HTML or in a separate js file.

To embed all you do is use the <script> tags

example: <script type="text/javascript">JAVASCRIPT HERE</script>

To put your javascript in a separate file you call it like this

example: <script type="text/javascript" src="THE URL OF YOU JAVASCRIPT CODE" />


This is how you open up Javascript

If you want to program it though you have to learn the language


Here are some examples

<script type="text/javascript">

document.writeln("Hello World");

</script>

The above code will write "Hello World" in a browser when ran.

<script type="text/javascript">

alert("Hello World");

</script>

The above code will make an error box or better called alert box, appear and it will say "Hello World"
First answer by MrEnder. Last edit by MrEnder. Contributor trust: 0 [recommend contributor recommended]. Question popularity: 1 [recommend question].