Find all elements on a page whose element ID contains a certain text using jQuery

前端 未结 4 860
既然无缘
既然无缘 2020-11-30 18:36

I\'m trying to find all elements on a page whose element ID contains a certain text. I\'ll then need to filter the found elements based on whether they are hidden or not. An

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 18:44

    Thanks to both of you. This worked perfectly for me.

    $("input[type='text'][id*=" + strID + "]:visible").each(function() {
        this.value=strVal;
    });
    

提交回复
热议问题