The purpose of the statements is to tell the browser what to do.
Normally you add a semicolon at the end of each executable statement.
Using semicolons also makes it possible to write many statements on one line.
You might see examples without semicolons.
Each statement is executed by the browser in the sequence they are written.
This example will manipulate two HTML elements:
Blocks start with a left curly bracket, and end with a right curly bracket.
The purpose of a block is to make the sequence of statements execute together.
This example will run a function that will manipulate two HTML elements:
You will learn more about functions in later chapters.
A function getElementById is not the same as getElementbyID.
A variable named myVariable is not the same as MyVariable.
You can break up a code line within a text string with a backslash. The example below will be displayed properly:
However, you cannot break up a code line like this:
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The HTML5 Certificate documents your knowledge of advanced HTML5.
The CSS Certificate documents your knowledge of advanced CSS.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
Your message has been sent to W3Schools.