quick basic javascript question

Soldato
Joined
6 Mar 2008
Posts
10,079
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?
 
Back
Top Bottom