Skip to content

Defining a custom HTML elements by creating a reusable comment element and making it dynamic with state.

Notifications You must be signed in to change notification settings

JenniferSmith007/reusable_WebComponent_VanillaJS

Repository files navigation

🔨 Building a Reusable Comment Component 🛠

Project Description:

Defining a custom HTML elements by creating a reusable comment element. The comment element with attributes to take in the content, you create an unlimited number of identically structured and styled comments with different content, and placing them by hand in the HTML.

Task:

  • Use Custom Elements: Can take a name, email address, and comment as an attribute.

  • Display the name, email address, and attribute, in a custom layout that’s built-in to the component

What was done:

  • Using the DOM, built a form and custom HTML element with attributes

    • created a template element to hold the information
  • Created a class that extends HTML

    • using the class to attach Shadow DOM and append the template
  • Defined the class and element with DOM customElements.define

* Second Branch explains how to make the comment component dynamic with basic state and built in Shadow DOM methods ➞ ➞ ➞

About

Defining a custom HTML elements by creating a reusable comment element and making it dynamic with state.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published