Skip to content

createElement at runtime #83

Open
Open
@messizqin

Description

@messizqin

Hi there, thanks very much for making this awesome project. I have a request if I may. I use javascript to create Dom element at runtime, and tries to apply dark mode on it after created.

let darkmode = new Darkmode(options);
let el = document.createElement('div');
el.style.width = '200px';
el.style.height = '200px';
el.style.background = 'red';
document.body.appendChild(el);
darkmode.toggle();

however, createElement will not be rendered. in my project, I create a lot of element through javascript at runtime, I wonder if there is a way I can get the entire page rendered including elements those created by javascript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions