2 ms·
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
by kearneyandy 10y 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.
- leojg 10y agoYeah 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