How to Write Using Javascript

How to Write Using Javascript

There isn't too much required to write using JavaScript. You just need to have basic Internet, computer and word processing skills---a little hypertext markup language (HTML) knowledge would help, too. It is the computer language (or code) that Internet browsers and computers use to talk to each other. JavaScript uses the same principles as HTML. It just adds a few more bits of language vocabulary.

Instructions

    1

    Format your work properly. Create a new file in Notepad and save it to your desktop with an html extension. This will generate a web page icon. Right-click on this icon, click the phrase "Open With" and then click Notepad. Your document is now ready to write using JavaScript.

    2

    Determine where you want your script to go. A major difference between HTML and JavaScript is the phrases you use. JavaScript builds on HTML language and where you place your phrases are important. Write using JavaScript with this main tag: "." You're going to place these two tags inside another tag called a "header." The header goes just under the main html tag (). A good example string will look like this: "

    ". You can place your script in either the header or body portion of your document. If you place scripts into your header tag, the code will run before a user page opens. If the code is placed into the body of a page (between body tags ), the Javascript will run after the Internet browser opens a web page.

    3

    Use the document dot write phrase (document.write), parentheses and quotes then place one semicolon at the end of every code line. Semicolons are just a way for a computer to recognize a break in information, just like a period at the end of a sentence. JavaScript is the only language that uses this syntax so don't wrap angle brackets around the document write phrase. The semicolon generates the break you need already. A sample will look like this: "document.write ("Place the text you want to appear on a page here.");". Take your script tags (listed above) and marry them with the document write phrase like this: "". You can place this script inside either your header or body, depending on what you want to have happen.

    4

    Use headers one through six. Header and headers one through six all work completely differently. The header tag looks like this "

    " while the first header series tag looks like this: "

    ." You can make headers throughout your page by writing JavaScript using the header numbers in ascending order like this "

    ". Know that the larger the numbers, the smaller your header will appear on a page. Make sure to marry a closed tag with each. Place these tags inside your document.write statement inside the quotes. An example will look like this: "document.write("

    Place the text you want to appear on the page here.

    ");".

Blog Archive