polybutton
polybutton copied to clipboard
Make data-href optional
Hey,
Thought it would be cool / DRY-er if it were possible to use the URL declared in the noscript tag.
This would save declaring a data-href value twice.
The change should respect existing data-href values in case users need to have different URLs for noscript vs. JS users. (Or to avoid breaking compatibility for existing users.)
Could also use Regex for this but DOM (well, innerHTML and DOM) feels safer. Browsers don’t create noscript DOM unless JS is disabled hence this slightly convoluted approach.