Why isn't the class style applied and the button working inside the webcomponent
09:00 25 Nov 2025

I am trying to understand how to make a web component with attributes. There is 2 problems I don't understand in the following code:

  • The div with the text 'the style of class is not applied' doesn't apply the class odd provided by the template despite having it.
  • The button just show the text 'non working button', there is no button to click on.


    
        testTemplate
        
        
        
        
    
    
        
javascript web-component