I have a unique element that I've created using the code below:
connectedCallback()
{
var custom_element = document.createElement('Div');
custom_element.class = 'element demo3';
this.appendChild(custom_element);
}
However, upon inspecting the source, I realized that the custom_element
's class is not being set to element demo3
.
All other modifications seem to work fine, such as
custom_element.style['background-color'] = 'red'
, etc.
Is it possible to change the CSS class of an element that is appended inside another custom element?