Is there a wildcard selector for identifiers (id)?

前端 未结 9 1673
臣服心动
臣服心动 2020-12-04 14:59

If I have an unknown amount of identifiers sharing a specific naming-scheme, is there a way to grab them all at once using jQuery?

// These are the IDs I\'d          


        
9条回答
  •  被撕碎了的回忆
    2020-12-04 15:43

    This is the only correct answer to the id wildcard question.

    $('[id*="Wild card in double quotes"]') 
    

    This will get "Wild card in double quotes. And there's more!!!", and also "More BS in front of Wild. Wild card in double quotes".

    You should use quote marks that are different than your '[]' tags.

提交回复
热议问题