- Access the content
- modify content
- program rules
- React to event

CSS rules : uses ti indecate how the contents of one or more element should be displayed in the bowser. Each rule has a selector and a declaretion block.
#Descining A Script: the goal of script it can work out the individual taskes nedeed to achieve it. Each individual task may be broken down into a sequence of steps.
there are two types of expressions: 1. EXPRESSIONS THAT JUST ASSIGN A VALUE TO A VARIABLE:it needs to begiven a value. As you have seen, this is done using the assignment operator (the equals sign). 2. EXPRESSIONS THAT USE TWO OR MORE VALUES TO RETURN A SINGLE VALUE:You can perform operations on any number of individual values (see next page) to determine a single value.
they allow programmers tocreate a single value from one or more values. there are types of operators: 1. ASSIGNMENT OPERATORS : Assign a value to a variable 2. ARITHMETIC OPERATORS :Perform basic math 3. STRING OPERATORS : Combine two strings. 4. COMPARISON OPERATORS : Compare two values and return true or false. 5. LOGICAL OPERATORS :Combine expressions and return true or false.
To creat a function you give it a name and then write the statments need to achieve its taske inside the curly braces. 1. you declear a function using the function keyword. 2. give a function name called identifier followed by parentheses. 3. the statments that perform the task sit in a code block. the function store the code required to perform a specific task and that script can ask the function to perform that task whenever you needed. If different parts of a script need to perform the same task; you dont need to repeat the same statments multiple times ; you use the a function to do it and reuse the same code.
first decleared the function then you can execute all the statments between its curly braces with just one line of code; and this known call function.
- TO run the code in function, you use the function name followed by parentheses.You can call the same function as many times as you want within the same JavaScript file.
- the function can store the instructions for a specific task.
- when you need the script to perform that task you call the function.
- the function execute the code in that code block .
- when it has finished, the code continues to run from the point where it was initially called.
sometimes a function needs specific information to perform its task.when you declear the function you give it parameters.this parameters insude the function will act as a variable.
when call a function that has parameters you specify the value it should use in the parentheses that follow its name.that value called arguments and it can provied as value or as variable.
- arguments as value : getArea(3,2)
- arguments as variable : dont need to specify actual values when calling function; you can use variable in their place.
some function return information to the code that called them such as when you perform a calculation they return the result.
