Homework: Strings
Create a file called strings.html for Parts 1 and 2.
Read MoreBooleans in JavaScript
A really important part of programming is being able to compare values in order to make decisions in code. Very often, in programming, you will need a data type that can only have one of two values, like YES / NO ON / OFF TRUE / FALSE When a comparison is made the outcome is…
Read MoreStrings in JavaScript
What are Strings? Simply put – anything you can type from the keyboard! Strings are treated as text or a sequence of characters. Characters can include: Letters: a-z and A-Z Numbers: 0-9 Spaces Special characters like underscores, dashes, asterisks and more Only thing that is tricky? Single and double quotes. We’ll talk about that. Basically…
Read MoreNumbers in JavaScript
Numbers are just that – numbers. Things like 1 or 100 or 5/12 or 26.5. In JavaScript all numbers – whether integers (whole numbers) or float (decimals) are stored in the same type. This is how you store numbers in variables. var number1= 16; var number2= 18.50; Math Operators Mathematical symbols are called operators in…
Read MoreHomework: JavaScript Output
Let’s reinforce what we learned out creating output to the user with JavaScript.
Read MoreInput in JavaScript
First, what exactly is input? Just like output is giving or displaying information to the user, input is getting information from the user. There are many ways to do this in JavaScript but right now we’ll learn how using two popup windows: the confirm box and the prompt box. The Prompt Box This is used…
Read MoreOutput in JavaScript
There are no built in print or display functions in JavaScript like there are in other languages. So, how do you display information to the user? There are two basic methods that we will earn today: alert() document.write() The alert() function We used this in our Hello World example. This creates a popup box that…
Read MoreHello World
The most common computer program and the one you will likely write over and over if you go on to more coding is the Hello World program. What does it do? It simply says hi. Let’s see how it would look in JavaScript. What’s going on here? First, we create an HTML file as we…
Read MoreHomework: Float
First create the 3 Column Page Layout that is the Float section of the class summary. Then, change your layout.html page around using float to look like this. You do have to do the menu yet – those three bright green buttons that say home, Coding Examples, CSS Handbook.
Read MoreFloat
An Element can be pushed to the left or right, allowing other elements to wrap around it. Float is often used with images but it is also useful when working with layouts. How Elements Float: can only be floated left or right horizontally It will float as far to the left or right as it…
Read More