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

How to change the innerHtml/content? #106

Open
niklas-dahl opened this issue Oct 27, 2016 · 0 comments · May be fixed by #123
Open

How to change the innerHtml/content? #106

niklas-dahl opened this issue Oct 27, 2016 · 0 comments · May be fixed by #123

Comments

@niklas-dahl
Copy link

niklas-dahl commented Oct 27, 2016

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.

@btopro btopro linked a pull request Aug 7, 2017 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant