JavaScript

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

no, all you have to do is move the next characters to a new line.

Do Template literals require you to use an escape sequence to give a new line for a multiline String?

kjkj

How do you reference a JS file in an html file?

querySelector() and querySelectorAll()

What methods is used to select CSS selectors

ES6 Template Literals

a new feature introduced in ECMAScript 2015/ ES6. It provides an easy way to create multiline strings and perform string interpolation. __________ are the string literals and allow embedded expressions.

Document Object Model

a programming API for HTML and XML documents. It enables Javascript to access and manipulate the elements and styles of a website. The browser creates a tree-like hierarchical representation of the HTML document, that tree-like structure is known as DOM Structure or a DOM tree.

Strubg.raw()

built-in function which accepts a string literal argument and returns raw string. It returns the strings without any interpretation of backslashed characters.

querySelector()

finds the first element that matches a CSS selector

removeChild()

method is used to remove an element from the DOM tree.

removeEventListener()

method used to remove an event handler that has been attached

querySelectorAll()

finds all elements that match a CSS selector.

addEventListener()

function is an inbuilt function in JavaScript used to handle the event.

Arrow functions

introduced in ES6, provides a concise way to write functions in JavaScript. They save developers time and simplify function scope.

One-line arrow functions

js functions that have implict return and defined without curly braces.

Multiline arrow functions ex. var sum = (a, b) => { let result = a + b; return "Sum is" + result; }; sum(5, 3); //output: "sum is 8"

js functions that have multiple statements inside the function, enclosed with curly braces and need an explicit return to return something.

hasAttribute(attribute_name)

method - Used to check an element has a specified attribute or not.

removeAttribute(attribute_name)

method - Used to remove an attribute with a specified name from an element

Raw Strings

method allows the accessing of raw strings as they were entered

appendChild()

method is used to add a node to the end of the list of child nodes of a specified parent node.

cloneNode()

method is used to clone an element. The cloneNode() method accepts an optional parameter. If the parameter value is true, then the original node and all of its descendants are cloned. If the parameter value is false, only the original node will be cloned.

createElement()

method is used to create a new element and attach it to the DOM tree.

insertBefore()

method is used to insert a node before another node as a child node of a parent node.

replaceChild()

method is used to remove an element from the DOM tree and insert a new one in its place.

textContent

property is used to get and set a text content inside a particular node.

innerHTML

property to get the text and inner HTML elements inside a the particular element and the setting will replace the existing text and inner tags inside an element with the new content.

const and let

the keywords allow developers to declare variables in the block scope, which means those variables exist only within the corresponding block.

nodes

The positions of the elements in the DOM tree are called...

String Interpolation

The process of inserting string representations of constants, variables, literals, and expressions into longer strings.

tagFunction`Hello ${firstName} ${lastName}!`

What is the syntax for a tagged template?

The getElementsByClassName() method used to select all the elements having specific class names. This method returns an array-like object of all child elements which have all of the given class names.

What method is used for selection Elements by class name?

The getElementsByTagName() method used to select HTML elements by tag name. This method also returns an array-like object of all child elements with the given tag name.

What method is used to select elements by tag name

no, it can run on the server side from Node.js allowing it to run on servers as the backend program for an application

Can JS only run on the client-side?

tagged templates

Tagged templates are one feature provided by ES6. Tagged templates allow us to parse template literals with a function.

backtick character

Template literals are strings that enclosed within the

element.addEventListener(event, function, useCapture)

The Syntax of addEventListener() function: event - Specifies the name of the event. function - Specifies the function to run when the event occurs useCapture - It is an optional parameter takes a boolean value. If the parameter value is true then the event handler is executed in the capturing phase. If the parameter value is false then the event handler is executed in the bubbling phase.

getAttribute(attribute_name)

Used to get the value of an attribute on a specified element

setAttribute(attribute_name, attribute_value)

Used to set a value of an attribute on a specified element,

client-side scripting language high-level, multi-paradigm, and interpreted

What kind of programming language is JavaScript in the context of web applications?

Events occur when user interaction takes place on a web page, such as when the end-user clicked a link or button, pressed a key on the keyboard, moved the mouse pointer, submits a form, etc. The browser also triggers the events, such as the page load and unload events. When an event occurs, we use a JavaScript event handler (or an event liste

what are events in context of JS

$(expression)

what is a embedded expression denoted with in JS?

Block Scope

what kind of scope can variables with let and const keyword have?

getElementById()

what method to select element by ID


Ensembles d'études connexes

Organizational Leadership Test 2

View Set

PEDS Chapter 37: Nursing Care of the Child With an Infectious or Communicable Disorder

View Set

Greetings - 1 (2)- 你好,朋友/老师/同学! (pinyin - English)

View Set

Pediatric Success: Issues Related to Pediatric Health

View Set

Chapter 40: Drugs for asthma and pulmonary disorders

View Set

inf 43 quiz study guide (all quizzes)

View Set

Medical Terminology Final Exam Review

View Set