You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected that I could see three input elements on body. but It wasn't. First element, declared by <my-input></my-input> isn't shown on page. I'm not sure that I've been using well extends property in Polymer. Something wrong in the code? I've followed primer guide
<body>
<!-- declare my-input element -->
<my-input></my-input>
<script>
var MyInput = Polymer({
is: 'my-input',
extends: 'input',
created: function() {
this.style.border = '1px solid red';
}
});
var el1 = new MyInput();
console.log(el1 instanceof HTMLInputElement); // true
document.createElement('my-input', MyInput);
var el2 = document.createElement('input', 'my-input');
console.log(el2 instanceof HTMLInputElement); // true
document.body.appendChild(el1); // Add input element has red solid border with MyInput
document.body.appendChild(el2); // Add input element has red solid border with input element extended from my-input
</script>
</body>
The text was updated successfully, but these errors were encountered:
I expected that I could see three input elements on body. but It wasn't. First element, declared by
<my-input></my-input>
isn't shown on page. I'm not sure that I've been using wellextends
property in Polymer. Something wrong in the code? I've followed primer guideThe text was updated successfully, but these errors were encountered: