Skip to content

JS: The Creation of Elements #375

@tomasznetcentric

Description

@tomasznetcentric

In one of our last PRs we introduced a new function to create elements to our Franklin library.

It is createElement('htmlTag', ['css', 'classes', ...], {properties: value, ...}) in scripts/lib-franklin.js

View createElement() in action on blocks/chapter-cards/chapter-cards.js

This feature helps us to keep our code organized and tidy. Of course, this feature speeds up the development time for future scripts. And in order to keep our code base in one line we need to refactor the current approach to how we create the elements.

So let's find each document.createElement() and their followers like: .classList.add(), .setAttribute() ....
and replace it with one sigle line.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions