0% found this document useful (0 votes)
11 views13 pages

(CS3Q4) LQ Reviewer

Uploaded by

ashclouds99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views13 pages

(CS3Q4) LQ Reviewer

Uploaded by

ashclouds99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Computer Science 3

Quarter 4 - Exam Reviewer

Date Revised: 05/–/2024


Prepared By: AK Alejandro

**Analyze codes

I. HTML Forms
● HTML form Tags
○ Group of tags that accepts input from the users. A single form can contain
multiple tags that accept different inputs. The tag is used to group
different form elements together.
○ The action attribute is used to indicate where the data inside the form
will be sent. The
action will only be
conducted when the
user triggers an event.
● Form handling is the processing of forms for interaction with the user and
retrieval of the inputted values for a server or a JavaScript code to use.

id attribute to access the HTML element in CSS and


JS.

Text field accepts a single line of text.

name attribute to refer to the HTML form element and


will be used by the browser when a form is
submitted.
<label> tag is used before the input tag to indicate
what a form element is for. The attribute
for is used to indicate which form tag it is
labeling. Other attributes for input: value
(initial value) and placeholder (label
inside)

Password used to accept password input from the


user. The characters are displayed as
black circles instead of the characters
being typed.

Number ● is used to accept numeric values


from the user.
● The attributes min and max are
used to set a limit for the numbers
to be entered by the user.
● Up and down arrow - increase or
decrease the number.
● When there is no value, the
starting number is one.

Button used to create a clickable button and call a


script or a function when the user clicks
on this element.
Submit ● used to create a clickable button
but instead of calling a script when
the user clicks on it, it triggers the
action attribute to execute.
● Action attribute causes the page
to submit all values typed inside
the tag to be submitted to the
server or a specified webpage for
processing.

Reset ● used to create a button that


restores all input areas to their
default values when clicked. If
there is no specified default value,
the default value is blank.

Fieldset ● Used to put related form elements


together in a group – similar to div
and span
● to organize data better for the
website.
● The attribute form that takes the
id of forms as values. By using this
attribute, the fieldset can be
associated with the form indicated
even if it is not inside the form
itself.

Legend ● Used to label the field set.


● Legends are to field sets as the
label element is to form elements.

Textarea ● to collect user inputs like


comments or reviews.
● can hold an unlimited number of
characters, and the text renders in
a fixed-width font (usually
Courier).
● specified by the cols and rows
attributes (or with CSS).

Form attributes

autocomplete ● used to complete values in input


boxes based on values that the
user has typed in previous
sessions. It is possible to have
autocomplete "on" for the form,
and "off" for specific input fields,
or vice versa.

disabled – is an attribute that does not take any


value. It can inhibit the user from
typing into the form element
where it is placed until a condition
is met

name used to add a name to the form. This


works like an id and a class name.
target used to define where the user inputs
will be displayed after the form is
submitted. This works like the
target attribute for links.

Novalidate ● used to tell the browser that it


should not check the correctness
of inputted values in the form.
● Some browsers have their own
input checker and will alert the
user if the input is incorrect. The
novalidate attribute overrides this
feature of browsers.
● Example: the page has the user
attempts to type in a <input type
=”number”> letter, the browser
will tell the user that it is an
invalid entry.

Radio Buttons Give the user a list of related items


where he/she can choose only one
value at a time
Checkboxes ● Like radio buttons where they
present the user with a group of
related choices and the chosen
value is the input of the user for
processing.
● Checkboxes allow the user to
choose more than one value

Checked attribute The default setting is no item is


selected

Checkboxes options with the same names By using a single name, we can iterate
but different values
through the choices like in an array.
Select ● List of choices in a dropdown
layout.
● One option can be chosen at a
time.
● Can also be set to accept multiple
options from the user by using the
attribute multiple, and pressing on
the ctrl or shift key when making
several selections

onsubmit Event handler will execute an action


when the user clicks on the submit
button.
onchange This is used to detect changes in value
of form elements.
onselect used to track when a user
selects/highlights a text inside an
input element or a textarea

onblur ● Used to track a user going away


from an input element.
● “Goes away” means that the user
may have clicked away, scrolled
away, or clicked on other input
elements. For checking if the input
from the user is valid.
onfocus user focuses on a form element -
clicking on the form element or
selecting it

II. More Control Structure

● while statement
○ repeats a statement or sequence of statements as long as they are
evaluated by a given conditional expression to a truthy value.
○ true (expression), the statements are executed again
○ false then the loop ends
○ repetition of a looping statement is known as iteration.
○ monitor the progress with a counter
■ incremented (increased)
■ decremented (decreased)



■ Should be 32


■ will be stuck in an INFINITE LOOP if you do not include code
that changes this value. It never ends in an infinite loop because its
CONDITIONAL EXPRESSION IS NEVER FALSIFIED.
■ a warning dialog box containing the text string 'Number is 1.' will
appear over and over again.
● do while statement
○ executes a statement or statements once, then repeats the execution as
long as it evaluates the true value of a given conditional expression.
○ condition sa dulo



● for int statement
○ more concise way of iterating over an object's properties. The for...in loop
will run for all of the object's elements


● break statement
○ \LOOP EXITS IMMEDIATELY without any other statements in the
loop being executed. Control is passed immediately to the statement
following the body of the loop.


● Continue statement
○ IT PREVENTS THE EXECUTION OF THE CURRENT ITERATION AND
GOES BACK TO THE BEGINNING OF THE LOOP to begin the next
iteration.
○ tuloy at hindi magbbreak


● Nested loop
○ type of loop that is made up of many loops
○ one loop within another
○ “Outer loop” is the first loop - “Inner loop” is the second loop
III. Arrays

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy