2

How to write XPath expression for @input. I'm trying this expression:

//input[@input='onSearchInput']. 

This expression not found.

HTML input tag:

<input type="text" class="input" @input="onSearchInput" placeholder="Word search" style="">
kjhughes
  • 106,133
  • 27
  • 181
  • 240
Sansli
  • 67
  • 1
  • 9

1 Answers1

1

Your markup is not well-formed due to the @ character in @input. Remove the @ character if you want to use XML-based tools such as XPath.

See also Is the at-sign (@) a valid HTML/XML tag character?

kjhughes
  • 106,133
  • 27
  • 181
  • 240
  • is it possible the others? e.g. cssSelector – Sansli Sep 13 '21 at 14:34
  • @Sansli: The markup-up itself is bad, so I wouldn't suggest relying on CSS selectors either, even if you did find an implementation with which it happened to work. – kjhughes Sep 13 '21 at 14:54