A
A
Andrey Filippov2016-03-29 07:06:40
PHP
Andrey Filippov, 2016-03-29 07:06:40

How to get element by part of attribute name and by value?

To get an element by part of an attribute, I use the following query:
//*[@*[starts-with(name(), "data-")]]
How can I get an element both by part of the attribute name and by value? For example,data-*="123"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2016-03-29
@andrysha-dev

Try this option
Finds all elements that have an attribute that starts with "data-" and has a value of "123". We take the value of the attribute just with the help of normalize-space (.).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question