Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
133
rated 0 times [  138] [ 5]  / answers: 1 / hits: 17236  / 8 Years ago, wed, june 1, 2016, 12:00:00

I have a field with input type search



When I try to select that with jQuery I get VM535 jquery-git.js:1529 Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: search



Check the fiddle - Fiddle



How do I select that field?
(note: I do not have any unique class or id applied to that field, actually it's plugin generated.)



Actually I am using jQuery DataTable plugin and I want to add a Go button just besides the search box. For this I am trying this workaround - to select the
search box with jQuery and add button besides it with insertAfter method. Please suggest me if there is any other way for this.


More From » jquery

 Answers
7

You can use attribute selector in such cases. Try this:



alert($('input[type=search]').val());


Working example here: https://jsfiddle.net/ashishanexpert/dsye8b2x/1/


[#61939] Monday, May 30, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brianaclaras

Total Points: 23
Total Questions: 106
Total Answers: 111

Location: Japan
Member since Sat, Jun 6, 2020
4 Years ago
brianaclaras questions
Fri, Oct 15, 21, 00:00, 3 Years ago
Thu, Dec 3, 20, 00:00, 4 Years ago
Mon, May 25, 20, 00:00, 4 Years ago
Wed, Mar 4, 20, 00:00, 4 Years ago
;