Hacker News new | ask | show | jobs
by kearneyandy 3680 days ago
Since document.querySelector only returns the first instance, you will need to run this for the number of redacted paragraphs. The above jQuery solution doesn't have this problem. You really would need a snippet with querySelectorAll and a loop. Since the page has jQuery, there's nothing wrong with providing a solution using it, and particularly since people just want to read the article.
1 comments

Yeah you are right... I didn't take into account if there is more than one element with that class, I was just trying to show that jQuery should not be the default solution when the language itself provides one