For the beginner, the words JavaScript and HTML are just terms that he/she has probably heard of. So, presuming that some of these beginners are reading this article, let’s start with the definition of these words. HTML stands for HyperTextMarkup Language which is, “the tags used to structure web pages so that a browser can display it in a way that is also influenced by the browser’s design and the user’s preferences for font, style, etc.” (See 1). Meanwhile, JavaScript is “a scripting programming language most commonly used to add interactive features and webpages.” (See 2).
Basically, HTML tags create what you put into your page and JavaScript allows you to manipulate what you put into your web page. Just imagine a web page that only has HTML on it. It would just look like a plain written document. You wouldn’t even be able to go to the next page. But if you use JavaScript on your web page, you would be able to move things around.
So, what are the benefits of using JavaScript in HTML code?
- JavaScript will improve visual displays
As mentioned earlier, if a web page will be plain HTML only, it would be just a page full of text. You would not be able to move around, and you won’t even be able to go to the next page.
- JavaScript will allow many page effects
Some page effects that JavaScript allows are:
- User’s time on page
- Popups and tooltips
- Collapsing text
- Page timeout
- Color changes and fades
- Fontsizing and fades
- Ultimate fader
- Embedded audio
- Print page/element
- Scrolling banners
- Flying text
- News scroller
- Automated popups
- Image transitions
- Toggle buttons
- JavaScript will add user interactivity
The special effects that are added to the web page will make it more interactive. The user/visitor of your website will want to keep exploring within the web site.
- JavaScript will provide seamless integration with user plug-ins
JavaScript not only provides access to HTML objects, it also gives access to browser and platform-specific objects like browser plug-ins (e.g. Adobe Acrobat, Media Player).
- JavaScript will allow client-side user form validation
If JavaScript is available, an initial validation of the website’s client can be done to check for simple errors such as missing information or non-numeric characters mistakenly placed in a non-numeric field. As a result, the user of the website gets faster feedback than having to wait for a response from the server.
- JavaScript will allow access to some system information
You need JavaScript to make your website visually attractive to potential clients and visitors by adding interactivity and dynamics to HTML pages. After all, who would want to go to a website that only had one page filled with text? The web page would not look good, not to mention boring.
So, use all the tools that you need to learn JavaScript. Just do research on the web or better yet, have an expert teach you. You will find out that making a great website can be easy.
1. http://www.upei.ca/~meincke/glossary.htm
2. http://en.wiktionary.org/wiki/Java_Script