I know you can use :contains to get elements who's innerHTML contains a certain string, but how can I get the elements whose innerHTML starts with a string?
Using a filter function you can filter based on any criteria that you'd like:
var spans = $("span").filter(function(idx) { return this.innerHTML.indexOf(myString) == 0; });
1.4m articles
1.4m replys
5 comments
57.0k users