Instructions
- ♦ HTML
- Dogs
- Cats
- Birds
- Reptiles
Working in HTML code can be complex but once you learn a few tricks, can enhance a person's website considerably. One of the sets of codes that have proven to be helpful are unordered lists. How these are added is by using a set of codes that distinguish you are adding a list to your site. For example, say you want to add a list of types of pets you may have supplies for at a pet store. You want to list these pets in the website as such.
If this is the desired output, using simple HTML code would accomplish this. You begin using an opening and closing tag of <ul></ul>. In the center of this you would include tags for each list item of <li></li>. An illustration of this all together is below. If this is entered, you will have a list included on your website.
<ul> <li>Dogs</li> <li>Cats</li> <li>Birds</li> <li>Reptiles</li> </ul>
Javascript code can be as complex as HTML. It has many complex sequences of codes that need to be used to identify things like objects that can be used in functions and methods. One thing that is very useful to know when working in this code are some of the operators that exist. Knowing these can save time and also make it easier to create things like if statements and loops. Some of the most useful I have found are below.
x += 2; same as x = x + 2 if x was 2, the result would be 4 x -= 2; same as x = x - 2 if x was 2, the result would be 0 x /= 2; same as x = x / 2 if x was 2, the result would be 1 x *= 2; same as x = x * 2 if x was 2, the result would be 4 x++; same as x = x + 1 AND x +=1. it adds one to whatever your variable is x--; same as x = x - 1 AND x -=1. it subtracts one to whatever your variable is !3 > 2 this flips the equation to say NOT 3 > 2 making the statement false.