Good news! We can easily write one ourselves.
$.extend($.expr[":"], { "startswith": function(elem, i, data, set) { var txt = $.trim($(elem).text()); var term = data[3]; return txt.indexOf(term) === 0; } });Simply place this into a convenient location (after your jQuery script) and you'll be able to use ":startswith"
For example: to find all the
s that have "blah" as their inner text, just do this:
$('div:startswith("blah")')...
Here's a jsfiddle to use as a quick demo: http://jsfiddle.net/richbuff/43AtR/
Hope this helps!
Nicely you explained everything in your article. Thanks for your information; this is nice and helpful… Definitely going to share this article to my friends.
ReplyDeleteGermany VPS Hosting
This comment has been removed by the author.
ReplyDeleteHello,
ReplyDeleteI appreciate your blogs.
It's a Nice blog Thanks for sharing. Will definitely try.
Get best USA VPS Hosting
service for your website.