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

c# - OpenXML hanging while writing elements -

php - regexp cyrillic filename not matches -

sql - Select Query has unexpected multiple records (MS Access) -