0

For some reason I need to get elements with an attribute value containing a string, without specifying the attribute name.

I tried [**="word"] and [*="word"] but it's not valid. Any ideas ? Thanks

Ashkan Mobayen Khiabani
  • 33,575
  • 33
  • 102
  • 171
FTW
  • 922
  • 1
  • 7
  • 19
  • Do you wish to set apart **string-type** elements of an array? – Mostafa Ayaz Jun 09 '19 at 14:15
  • I'm not sure to get what you mean, I have a set of node and subnodes, and some of them will have attributes whose value contains a word. I have a treatment to perform on these nodes (add a data-attribute). – FTW Jun 09 '19 at 14:22
  • I was about to add a comment, but the question was closed. There is another post the might help you on SO besides the one mentioned above. https://stackoverflow.com/questions/2048720/get-all-attributes-from-a-html-element-with-javascript-jquery – SScotti Jun 09 '19 at 14:27
  • Yeah I used that for something else but since I want to traverse the children nodes too it's not that convenient. I'll use it too if I want to search customely – FTW Jun 09 '19 at 14:32

0 Answers0