Currently, I am working on an application using Stenciljs and have created a custom element like this:
<custom-alert alertType="warning" alertId="warningMessage" hide>Be warned</custom-alert>
The challenge arises when attempting to select this element for manipulation with document.querySelector()
or similar methods in order to add or remove the hide
attribute. While it's straightforward for standard HTML elements like so:
document.querySelector('input').removeAttribute('hide');
I'm wondering how to achieve the same functionality with my custom element?