Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

How to change the innerHtml/content? #106

@niklas-dahl

Description

@niklas-dahl

Description

I'm quite new to polymer so this might be a stupid question, but how do I change the content inside this button elmement?

When I create an Element I would write:

<paper-toggle-button checked>Button 1</paper-toggle-button>

and it works great, but how can I programmaticly change the 'Button 1' text?
I searched here: https://elements.polymer-project.org/elements/paper-toggle-button
And tired:

let b = document.createElement('paper-toggle-button');
b.innerHTML = 'My custom text';
document.body.append(b);

But this overrides the internal dom inside the button..

I want to use d3 to create these Elements dynamically.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions