Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JQuery - How to find $(#...) id by filter/wildcard?

Status
Not open for further replies.

fletchsod

Programmer
Dec 16, 2002
181
Let's say I have those ids...

<span id="spanHtmlForm_rbSoftware">...</span>
<span id="spanHtmlForm_txtCompany">...</span>

How would I find those two "span" ids with a filter/wildcard in JQuery? I tried the "*" and it doesn't do the trick, so I welcome suggestion or help.

$('#spanHtmlForm_*').css({ "background-color":"#ff0000" })

Thanks...
 
While finding an element by id is the fastest/easiest selector, it can be abused. Could you filter the results based on something other than the id?
Code:
$('span.an_identifyin_class')
$('form>span')
$('#spanHtmlForm_rbSoftware, #spanHtmlForm_txtCompany')
$('span[id=spanHtmlForm_*]')


Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top