QUESTIONS AND SOLUTIONS RATED A+
✔✔Canvas API - ✔✔var ctx = canvas.getContext('2d');
Draw graphics outside of the HTML code and the user can interact with.
Animation, game graphics, data visualization, photo manipulation, and real-time video
processing
✔✔Drag and Drop API - ✔✔A typical drag operation begins when a user selects a
draggable element, drags the element to a droppable element, and then releases the
dragged element.
It must have the attribute draggable set to true in the HTML
✔✔Drag/drop HTML code - ✔✔<img draggable="true">
Needs true or false <img draggable> does not work
remember this
✔✔get an element that has been marked as draggable - ✔✔const draggableElement =
document.getElementById('draggable-element');
✔✔add dragstart listener to the element -
✔✔draggableElement.addEventListener('dragstart', onElementDragStart);
✔✔add drag data to the event - ✔✔function onElementDragStart(event) {
event.dataTransfer.setData('text/plain', 'draggable-element');
}
✔✔History API - ✔✔Controls the URL and lets navigational changes appear without
reloading the page and bookmark the specific state without a individual url
aka use the browser back/forward buttons as navigation elements
history.pushState({page: 1}, 'Page One', '?page=1')
✔✔File System API - ✔✔access to the local users file system even without uploading it.
It can only read it, not update it.
✔✔input field email - ✔✔looks like a text field but has validation properties
✔✔input field image - ✔✔click on the picture to submit the form
✔✔input field search - ✔✔like text but line breaks are removed wen submitted
✔✔input field url - ✔✔looks like text but has some validation
, ✔✔client side form validation vs server side - ✔✔its a good practice to implement both.
On the client side it helps to make the form more user friendly and faster, since a typo
can be detected prior the form submission
✔✔built in form validation pros/cons - ✔✔uses html form validation. best performance
but less configuration
remember this
✔✔javaScript form validation pros/cons - ✔✔slower than built in but more customizable
remember this
✔✔Form Validation
a - ✔✔matches one character that is a (nothing else)
✔✔Form Validation
abc - ✔✔matches abc. Not ab or abcd
✔✔Form Validation
ab?c - ✔✔Matches ac or abc. The character in front of ? is optional
✔✔Form Validation
ab*c - ✔✔matches a followed by any number of b and one c
abbbbbbbc
✔✔Form Validation
a|b - ✔✔matches one character a or b but not ab
✔✔Form Validation
[Aa]pple - ✔✔matches Apple or apple
remember this
✔✔Form input validation to follow a string (code line example) that has 4 valid inputs:
Banana, banana, Cherry, or cherry. Make sure you understand why only those four are
valid. - ✔✔<input id="choose" name="i-like" required pattern="[Bb]anana|[Cc]herry" />
✔✔<input ????="number"/> - ✔✔type
✔✔what is <fieldset> - ✔✔group several controls and labels within a web form. Regroup
in semantic ways
<form>
<fieldset>
<legend></legend>