My heading 1 is not display. I try it with value and object. Thanks you. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

My heading 1 is not display. I try it with value and object. Thanks you.

Display heading. https://code.sololearn.com/WWn5O6tTSYi8/?ref=app

24th Jun 2021, 3:47 AM
Malick Diagne
Malick Diagne - avatar
2 Answers
0
the problem is with heading.value You want text to be in between the tags. So use heading.textContent or heading.innerText heading.value will look for value attribute which heading doesn't have.
24th Jun 2021, 4:00 AM
Aravind Shetty
Aravind Shetty - avatar
0
class Myheading extends Heading { constructor (value,color) { super (value); this.value = value; this.color = color; } value () { return this.value ; } color () { return this.color ; } In this code you don't have to explicitly define value() method and this.value property. super(value) will do it for you. class Myheading extends Heading { constructor (value,color) { super (value); this.color = color; } color () { return this.color ; } This will also work
24th Jun 2021, 4:07 AM
Aravind Shetty
Aravind Shetty - avatar