Skip to content

Instantly share code, notes, and snippets.

@Guidhouse
Last active October 6, 2015 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Guidhouse/4030d6ac7ba5bc723d88 to your computer and use it in GitHub Desktop.
Save Guidhouse/4030d6ac7ba5bc723d88 to your computer and use it in GitHub Desktop.
Fun in the browser
Just for fun, hidding all shirts that doesn't have breast-pockets.
http://www.hawesandcurtis.co.uk/menswear/formal_shirts?fit=39&viewAll=True
Vanilla JS:
Firefox:
[].slice.call(document.getElementsByClassName('standard-product')).filter(x =>!(x.textContent.contains('Pocket'))).forEach(function(el){el.style.display = 'none'})
Edge (No contains):
String.prototype.contains = function(stringToSearchFor){return this.indexOf(stringToSearchFor) >-1;}
[].slice.call(document.getElementsByClassName('standard-product')).filter(x =>!(x.textContent.contains('Pocket'))).forEach(function(el){el.style.display = 'none'})
Chrome(No fat arrow, no contains):
[].slice.call(document.getElementsByClassName('standard-product')).filter(function(el){return el.textContent.indexOf('Pocket') === -1}).forEach(function(el){el.style.display = 'none'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment