Posted by: Stephen Gray on: 5 August, 2008
UPDATE: The below method no longer works! Go here to see a tested, working method: http://ropox.net/archives/1081
This is the first tutorial on my blog. We’re going to start with something simple and it’s only useful if you use jQuery.
When I started using jQuery I found it hard to find information on using wildcards when selecting DOM elements.
After a while you get to understand that jQuery allows the use of regular expressions in a lot of places, I.E. when selecting like this:
$('#myElement').html();
So with this in mind, you can use \\S* to make wildcard selections, I.E.:
$('#myEle\\S*').each();
Stephen.
Nice find! I didnt even know you could use regex on selectors!
Thanks man
[...] Flex 3 DataGrid double click eventjQuery wildcard selectorsFlex getting selected RadioButton valuejQuery loading remote/external javascript files using [...]
Hi, i see your regex! Its nice to know you use those! But i have a problem, im not sure on how to use the regex.
i need to search for all nested li`s within a ul ( where any li can have it`s own ul with li`s) but i cant get it right tho..
What would be the query or regex for this?
#navigation * li doesnt work.. so im kinda not sure what to do now
8 August, 2008 at 9:27 am
Thanks for this post, just what I’ve been looking for. Many of my pages had validation errors because of duplicate IDs (for example the user image layer on comment pages).
Knowing this is possible allows me to simply attach a random token to the IDs so make them unique, but still be able to select the boxes without tracing the token.