JavaScript is Case Sensitive

By: Dusty Arlia
Published on March 6, 2013
Last Updated on Saturday, July 11, 2015 at 7:15 PM
Total Updates: 2

Whether you're typing a variable name or a keyword, make sure you remember that JavaScript is case sensitive. For example getElementByID is not the same as getElementById (notice the last letters have different cases). HTML which is case insensitive for the most part has a couple attributes that are indeed case sensitive: id and class. JavaScript accesses HTML to change parts of the webpage, colors, text, and more. This is often done using the id and class HTML attributes. For example, JavaScript must use the right id value in its getElementById function:

document.getElementById("myExampleDivId");

This JavaScript code can be used to access this HTML element:

<div id="myExampleDivId">Here is a div on my HTML page. Remember this element's id is case sensitive.</div>

Comments:

Ad: