can html and java script live side by side in a webpage?

They have: 2 posts

Joined: Apr 2000

I am wondering whether it is possible to put html code and javascript on the same webpage and if so are there obstacles I need to be aware of ?

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi,

Yes, in fact I don't remember the last time I've seen a page without both.
The only real obstacle you'll run across will be placement. Occasionally, you'll get "...has no properties...is not an object" errors. These usually mean the browser is parsing the javascript before the html.
http://www.htmlgoodies.com has an excellent 30+ lesson primer on javascript, that really includes html.

Vinny

------------------
GrassBlade: cut&paste javascript

Where the world once stood
the blades of grass cut me still

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.