Javascript Quiz Reviewer
Internal JS
*hindi ko malagyan ng definition ewan ko baket laging nagccrash*
Keywords
- are reserved words and cannot be used as variable name - tells about what kind of operation it will perform
<label>
- element is used to associate a label with a form input - It helps in improving accessibility by providing a textual description of the input field
<button>
- element is used to create a clickable button on a form - It can be used for triggering form submission or performing other actions
<form>
- element is used to create a form container that wraps all the form elements - It defines the start and end of the form and provides various attributes for controlling form behavior
Local variables
-declared inside function -are visible to function only and can't be shared across functions
Global variables
-declared outside the function -can be shared across functions
Javascript operators
1.Arithmetic Operators 2.Comparison (Relational) Operators 3.Bitwise Operators 4.Logical Operators 5.Assignment Operators 6.Special Operators
3 forms of if statement
1.If Statement 2.If else statement 3.if else if statement
statements
A computer program is a list of "instructions" to be "executed" by a computer. In a programming language, these programming instructions are called ___
Structural isomorphism
DOM structure models is ____
Local variables
Declare a variable inside of block or function (Two types of variables in JavaScript)
Global variables
Declare a variable outside function or with a window object (Two types of variables in JavaScript)
Form Control Elements
Form can have many control elements such as text fields, buttons, radio buttons, checkboxes, etc.
structure
HTML is used to ___ the web pages
Anchor Object
It is represented by a href tags.
Form Object
It is represented by form tags.
Link Object
It is represented by link tags.
Server-side code
It supplies objects relevant to running JavaScript on a server
Client-side, Server-side
JavaScript can be used for ____ developments as well as ____ developments
Code Blocks
JavaScript statements can be grouped together inside curly brackets
80 characters
Javascript code preferred line length by most programmers is up to
Whitespace
Javascript ignores multiple white spaces
imperative, declarative
Javascript is both ____ and ____ type of language
behavior
Javascript is used to add ___ to our web pages
Keydown, Keypress, and Keyup Events
Occur when a key is pressed, while it is being pressed, or when it is released.
Focus and Blur Events
Occur when an element gains or loses focus, typically used with input fields or form elements.
Mouseover and Mouseout Events
Occur when the mouse pointer enters or leaves an element.
Submit Events
Occurs when a form is submitted, typically when the user clicks a submit button.
Click Event
Occurs when a mouse button is clicked on an element.
Resize Event
Occurs when the browser window or an element is resized.
Load Event
Occurs when the page finishes loading
Scroll Event
Occurs when the user scrolls the page or scrolls within an element
getElementById()
The ___ method returns an element with a specified value
after
The best place to break a code line in Javascript, if it doesn't fit, is ___ an operator
type
The specific type of input is defined by the ____ attribute.
False
True or False: DOM is a rendering engine
False
True or False: DOM is a static representation
True
True or False: DOM is a way to represent the webpage in a structured hierarchical way
False
True or False: DOM is limited to HTML
True
True or False: DOM is not a programming language
True
True or False: DOM is not limited to browsers
True
True or False: JavaScript contains a standard library of objects, like Array, Date, and Math, and a core set of language elements like operators, control structures, and statements
True
True or False: The DOM is a dynamic model that reflects the current state of a web document
Document Object Model
What does DOM stand for?
Document Object
When an HTML document is loaded into a window, it becomes a ___
function
_____ functionName(param-1, param2.....param-n) { statement(s); }
Body
a block of statements to be executed
Name
a unique name given by developer
Formal arguments
are the names listed within parenthesis in function definition
Actual arguments
can be variables or literals
External JS
can write JavaScript code in other file having an extension.js and then link this file inside the <head> tag of the HTML file in which we want to add this code
<select>
element creates a dropdown list
<option>
element defines the available options within the dropdown
<textarea>
element is used to create a multiline text input field where users can enter larger blocks of text
<input>
element is used to create different types of input fields, such as text fields, checkboxes, radio buttons, submit buttons, etc.
<fieldset>
element is used to group related form elements together
<legend>
element provides a caption or title for the <fieldset>
Formal arguments
function sum (num1, num2) { var result; result = num1 + num2; return result; } What is "(num1, num2)" in this syntax?
Function name
function sum (num1, num2) { var result; result = num1 + num2; return result; } What is "sum" in this syntax?
Body
function sum (num1, num2) { var result; result = num1 + num2; return result; } What is "var result; result = num1 + num2; return result;" in this syntax?
Local variable declaration
function sum (num1, num2) { var result; result = num1 + num2; return result; } What is "var result;" in this syntax?
function
is a block of JavaScript code that is defined once but may be executed, or invoked, any number of times
Javascript
is a lightweight, crossplatform, and interpreted compiled programming language which is also known as the scripting language for webpages
Document Object Model
is a programming interface for HTML(HyperText Markup Language) and XML(Extensible markup language) documents
Window Object
is object of the browser which is always at top of the hierarchy
Structural model
is sometimes used to describe the tree-like representation of a document
JavaScript if-else statement
is used to execute the code whether condition is true or false
Return statement
is used to return primitive value or reference of an object
Client-side code
it is run inside a web browser and has little or no access to the underlying operating system
Semicolons
marks the end of a statement in a Javascript
getElementsByClassName()
returns all the elements having the given class name.
getElementsByName()
returns all the elements having the given name value.
getElementsByTagName()
returns all the elements having the given tag name.
getElementById()
returns the element having the given id value.
Javascript Variables
simple name of storage location where data to be stored
Parameters/arguments
to pass on input values to function
write("string")
writes the given string on the document