javascript - Get values of Input[type=(type)] from specific class with jQuery -


i have code not work:

kw _class = _keyword1; var text = $("'input." +  kw_class  + "[type=text]'").val(); var val =  $("'input." +  kw_class  + "[type=hidden]'").val(); 

firefox console comes out this:

`syntax error, unrecognized expression: 'input._keyword1[type=text]' 

i have tried @ least 3 combos of not working found other questions.

yes because have ' ' inside of selector. should be:

var text = $("input." +  kw_class  + "[type=text]").val(); var val =  $("input." +  kw_class  + "[type=hidden]").val(); 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -