Skip to content

Instantly share code, notes, and snippets.

@brol1dev
Created August 1, 2023 22:14
Show Gist options
  • Save brol1dev/3ecdbdb9e2865e043929dff8ff5c1a77 to your computer and use it in GitHub Desktop.
Save brol1dev/3ecdbdb9e2865e043929dff8ff5c1a77 to your computer and use it in GitHub Desktop.
Ramp url flag decode script
function getValue(ul) {
const li = ul.querySelector('li');
if (!li) {
return null;
}
const div = li.querySelector('div');
if (!div) {
return null;
}
const span = div.querySelector('span');
if (!span) {
return null;
}
const value = span.getAttribute('value');
return value;
}
const uls = document.querySelectorAll('ul');
const valueArr = []
for (const ul of uls) {
const value = getValue(ul);
if (value) {
valueArr.push(value);
}
}
console.log(valueArr.join(''));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment