So I've been messing around with Javascript lately.
I wrote this to mess with some page code:
What I'm trying to do is remove a "hidden" attribute from an element with that class name.
Thing is, it works in the Inspect console,but when I stick it in a bookmark or the onmibar it never works and I have no idea why.
Pretty new to JS so it's probably staring me straight in the face and I haven't caught it yet.
I wrote this to mess with some page code:
Code Select
javascript:
var divs = document.getElementsByClassName("corrupted-repair-button");
for (var x = 0; x < divs.length; x++) {
var elem=divs[x];
elem.removeAttribute('hidden')
}
What I'm trying to do is remove a "hidden" attribute from an element with that class name.
Thing is, it works in the Inspect console,but when I stick it in a bookmark or the onmibar it never works and I have no idea why.
Pretty new to JS so it's probably staring me straight in the face and I haven't caught it yet.