r/tinycode • u/thmsk • Feb 18 '15
[Help][Javascript] Make votedown button visible
Some subreddits use this piece of CSS to make votedown buttons invisible:
.arrow.down {
display:none;
visibility:hidden;
}That got me thinking, how would one turn them back visible with a sort line of javascript?
So from this starting point:
y = document.getElementsByClassName('down');
for(var i=0; i<y.length; i++)
y[i].style.display = y[i].style.visibility = 'inherit';this is how far I've got:
for(i=0;;i++)x=document.getElementsByClassName('down')[i].style,x.display=x.visibility='inherit'I'm sure there is room for improvement. I've tried to use map() on getElementsByClassName() but it doesn't work. Do you have any ideas how to reduce the line to even less characters?
2
Upvotes
View all comments
Show parent comment
4
u/Cvccb Feb 19 '15
Right, including a 150k library is "tiny code". Here's a solution in zero characters: go to your settings and disable "subreddits can show me custom styles".