Eventhandlers

onsubmit

  • fires when the user submits a form

onmouseover

  • fires when the user moves the mouse over a particular element

event.preventDefault()

  • if the event does not get explicitly handled, its default action should not be taken as it normally would be

 

<textarea></textarea>

 

  • can assign how many rows and width
<textarea rows="5" cols="40" id="comment_input"></textarea>
  • allows user not to change size of textarea
textarea{
resize: none;
}

Local Storage

  • get items: brings string out from local storage
  • set items: save string inside local storage

reference: https://www.taniarascia.com/how-to-use-local-storage-with-javascript/

 

DOM

  • html을 object관점에서 보는 방법
  • DOM !== html
  • DOM !==JavaScript
  • document.body.(property)

 

String.prototype.trim()

  • removes whitespace from both ends of a string

 

arrayLike

  • An array-like or iterable object to convert to an array
  • can get index key and length but cannot use array property like forEach method
  • ex. string, object

 

Spread Syntax

  • to combine into array when the type is not an array
  • has to be iterable like array or arrayLike

 

QuerySelectorAll

  • cannot put eventlistener together
  • has to be per tag

 

tag.textContent or input.value

  • remembers when event happens and where to call that values
  • if you call in wrong spot, it will not show

'TIL' 카테고리의 다른 글

TIL 2020.11.14  (0) 2020.11.15
TIL 2020.11.12  (0) 2020.11.14
TIL 2020.11.11  (0) 2020.11.14
TIL 2020.11.09  (0) 2020.11.09
TIL 2020.11.08  (0) 2020.11.08

+ Recent posts