JS FS BC W6

Chunhao Weng
2 min readAug 8, 2021

Random notes. Unorganized thoughts. Not an article.

replaceWith() method might not be supported, lookup parent and use replaceChild() method instead.

NodeList

inline, on-event, then modern addEventListener

“To manipulate an element inside the DOM, you first need to select it and store a reference to it inside a variable.”

https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Manipulating_documents

Shortcut for Emojis for Mac on CodePen

Control + Command + Space

<input type=”text” name=”username” pattern=”[a-zA-Z]{8}”>

“The main selling point for using tel over text is on mobile, where the device can choose to show a numeric keyboard.”

“As with the other form tags, the name attribute determines the name in the data sent to the server:”

on focus …

history.pushState(state, '', '/anotherPage')

“The second parameter is currently unused by major browsers, so you generally pass an empty string.”

“$0 always refers to the last node that you selected. $1 refers to the node you selected before that. And then $2, and $3, etc.”

“always avoid adding sensitive information to cookies”

“MDN says “The order of keys is user-agent defined, so you should not rely on it”.”

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Chunhao Weng
Chunhao Weng

Written by Chunhao Weng

Random notes for personal use.

No responses yet

Write a response