0

I need to search my website for all instances where an attribute value contains a certain keyword. For example: In the following snippet I have an aria-label which contains the word taco. I would crawl my site and find all pages which contains the word "taco". Does anyone know a site or tool which can do this?

<a href="eattaco.html" aria-label="eat a taco">hungry?</a>

Thanks in advance.

Matthew
  • 41
  • 8

1 Answers1

0

You could use a jQuery selector to do this.

e.g.

$("[aria-label~='taco']")

will return all the elements whose aria-label contains the word 'taco'.

See this answer here: Find an element in DOM based on an attribute value

Robbie Cook
  • 164
  • 1
  • 6
  • Thank you Robbie. However, I am looking for a way to apply this jquery to a sitewide search. Problem is we have 500 plus dynamic pages in which this attribute is pulling from a database and the format in DB is unreadable. – Matthew Aug 29 '19 at 15:28