WeSearch

DOM methods part 2

·1 min read · 0 reactions · 0 comments · 2 views
DOM methods part 2

What is createElement()? It is used to create a new HTML element using...

Original article
DEV Community
Read full at DEV Community →
Opening excerpt (first ~120 words) tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3734090) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Nanthini Ammu Posted on Apr 28 DOM methods part 2 #webdev #javascript #beginners #tutorial What is createElement()? It is used to create a new HTML element using JavaScript. Creating an element is a multi-step workflow because the element is added in JavaScript memory, not on the screen. It consist of 3 step.

Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV Community.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from DEV Community