Beruflich Dokumente
Kultur Dokumente
Internal file:<style>,,,,,</style>
-external file of the javaScript file (itd be better to put it after the
css external file) :
<script src=.js></script>
-javascript code can be put in the head or the body of the html code
-javascript external file should be put before the body closing tag
Var x=3,
Y=4,
Z=9;
Variables:
-name of variable must start with underscore _ or letters or signs
never with numbers and the name must be written with the camel
case system.
Data type:
-string=name or name
You can write double quotes within single quotes and vice versa
my name is bahia
Output:
Operators:
( -) (+) (=) (*)(/)(%) you can use the counter +++++ to add something
endless to the element
Assignment operators:
(=) value
Logical operators:
(!==)it is not equal the value and neither the data type
(&&)and
(l l ) or
Functions:
Events:
- window.onload = function () {}
- window.onclick = function () {}
- window.ondblclick = function () {}
- You can create an event without the window code by writing to
function description within the opening tag of the element in
html: <button event=functionName()>
- You can create many events at once , in the opening tag of the
html element and describe it within the script sheet
- Onkeyup will start doing the function when you leave the press
- Onkeydown will start doing the function when you press enter
- Onmouseover will do the event when you hover with the
mouse on item
- Onmouseout will do the event when you leave hovering with
the mouse on item
- Onchange is an event that keeps up with your changes
according to your next change
Arrays:
new name,
New name,
New name, !!!!!!new names are elements
New name,
)
Literal way to write arrays codes :
Var name = [
new name,
New name,
New name,
New name,
]
- To get the length of your array by creating:
console.log(name.length ) it will show up in the console
- the length always is bigger than the index number with 1 , the
index starts with zero but length with 1
- you can set the number of the arrays length by creating:
name.length = number
object.hasOwnProperty( variable ){
statement
-syntax while:
While(condition){
statement ;
final expression which executed every time the code runs;
Do while syntax:
Do {
Statement ;
} While(condition)
If statement: