2
I would like to select an input type text field that contains the word "hi" typed in it.
Assuming my input is this:
<input type='text' id='texto' />
I saw that it is possible through:
$("#texto[value='oi']")
But I saw that it only works if the value is explicit in the attribute "value". It does not happen most of the time.
Have some other selector for me to achieve this without having to set the input value attribute?
What do you mean? You have to know the value to select by it
– Lucas
Exactly. In this case the word "hi" to serve as an example.
– Joao Paulo
I didn’t understand this: "...without having to set the input value attribute?"
– Lucas
If an input is written like this: <input type='text' value='Blabla' /> I can pick it up with the $("input[value='Blabla']") selector, but if the input is written <input type='text' /> and I type the Blabla text, the $("input[value='Blabla']") selector, nothing is found. Realized the difference?
– Joao Paulo
@Lucas The issue is text typed by the user, I believe.
– Miguel Angelo