HTML tags, JavaScript Functions Flashcards

1
Q

displays the alert box containing message with ok button

A

alert()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

displays the confirm dialog box containing message with ok and cancel button

A

confirm()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

displays a dialog box to get input from the user.

A

prompt()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

opens the window.

A

open()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

closes the window.

A

close()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

performs action after specified time like calling function, evaluating expressions etc

A

setTimeout()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

JavaScript BOM (Browser Object Model)

A
  1. alert()
  2. confirm()
  3. prompt()
  4. open()
  5. close()
  6. setTimeout()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The ____ object represents the whole html document

A

Document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

writes the given string on the document.

A

write(“string”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

writes the given string on the document with newline character at the end.

A

writeIn(“string”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

returns the element having the given id value.

A

getElementById()
WALANG “S” SA ELEMENT DITO HA!!!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

returns all the elements having the given name value.

A

getElementsByName()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

returns all the elements having the given tag name.

A

getElementsByTagName()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

returns all the elements having the given class name.

A

getElementsByClassName()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The Access the target element(s) using methods:

A
  1. getElementById()
  2. getElementsByName()
  3. getElementsByClassName()
  4. getElementsByTagName()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Displays an alert dialog box with a message

A

alert()

17
Q

Displays a dialog box to prompt the user for input.

A

prompt()

18
Q

Displays a dialog box with a message and OK/Cancel buttons.

A

confirm()

19
Q

Converts a string to an integer.

A

parseInt()

20
Q

Converts a string to a floating-point number.

A

parseFloat()

21
Q

Converts a value to a string

A

String()

22
Q

Converts a value to a number.

A

Number()

23
Q

Checks if a value is NaN (Not-a-Number).

A

isNaN()

24
Q

Generates a random number between 0 and 1.

A

Math.random()

25
Q

Rounds a number down to the nearest integer

A

Math.floor()

26
Q

Rounds a number up to the nearest integer.

A

Math.ceil()

27
Q

syntax changes the text content of the specified element to the provided value.

A

textContent
element.textContent = ‘New text content’;

28
Q

syntax changes the HTML content of the specified element. It can include tags and will be rendered as HTML.

A

innerHTML
element.innerHTML = ‘< strong >New HTML content
< /strong >’;

29
Q

method searches a string for matches against a regex pattern and replaces them with a specified replacement string

A

replace()

30
Q

method checks whether a given string matches a specified regex pattern. It returns a boolean value indicating whether the pattern is found or not.

A

test()

31
Q

method searches a string for matches against a regex pattern and returns an array of the matched results.

A

match()

32
Q

method splits a string into an array of substrings based on a specified regex pattern.

A

split()

33
Q

method searches a string for a specified regex pattern and returns the index of the first match found. If no match is found, it returns -1.

A

search()

34
Q

JavaScript built-in methods for Regular Expression:

A
  • test()
  • match()
  • replace()
  • split()
  • search()