I am dealing with multiple sites that contain the following code snippets:
<script async custom-element="amp-sidebar"....
<script async custom-element="amp-slider"....
My aim is to extract all the custom-element properties using vanilla JavaScript exclusively. Since there are no IDs for the script tags and custom element is a non-standard attribute, I am considering adding a data- prefix.
I attempted the following approach, however it did not yield the desired results.
document.querySelectorAll('script[custom-element]')