quick basic javascript question

Soldato
Joined
6 Mar 2008
Posts
10,084
Location
Stoke area
Just brushing up on my web skills and starting picking up Javascript too.

The examples I am using will use things like this:

Code:
var guessInput = document.getElementById("guess");
var guess = guessInput.value

is it not just simpler to use:
Code:
var guess = document.getElemenyByID("guess").value
I know in some languages things can be done but are frowned upon so wanted to check what the standard is?

Also, camel case variables? yes? no?
 
thanks, didn't think about using other attributes on it, always good to have a second pair of eyes :D

Thanks for the tip trip :D
 
Back
Top Bottom