The
div[class^="test"]
selector will not match an element in markup if the element will be
class=" test-something"
(The intended selector had been generated on backend.)
The
div[class^=" test"]
is not an option.
Any suggestions?
The
div[class^="test"]
selector will not match an element in markup if the element will be
class=" test-something"
(The intended selector had been generated on backend.)
The
div[class^=" test"]
is not an option.
Any suggestions?
What you did there ^=
is:
'begins with..'
div[class^="test"] { }
which would work on something like this:
<div class="test and-some-class"></div>
<!-- only if the very first string in your class matches "test" -->
<!-- so, class=" test something-else" won't work
You would have to use the CSS Selector:
'contains..'
div[class*="test"] { }
which would work on
<div class="class test something-else"></div>
<!-- class name can be anything. "test" can be anywhere -->
Reference