Making partial matches with jQuery?

后端 未结 2 867
梦如初夏
梦如初夏 2020-12-14 15:33

I want to find all input boxes with id containing _date

My code is like this:



        
相关标签:
2条回答
  • 2020-12-14 16:05

    If you just want to check ending with "_date" rather than containing "_date" you can use

    $('input[id$="_date"]')
    
    0 讨论(0)
  • 2020-12-14 16:14

    I'm thinking of one of these...

    $('input[id*="_date"]').css('background-color', 'red');

    0 讨论(0)
提交回复
热议问题