How To Match Long ID Strings Using JQuery

Published Date Author: , Posted August 19th, 2011 at 11:03:17am

Ran into an odd issue matching the id attribute in jQuery when it is extra-long.

Seems like the syntax:

jQuery('#LongIDNameGoesHere')

doesn’t match long ID’s, when the syntax:

jQuery('[id^=LongIDNameGoesHere]')

does match correctly.

Not entirely sure yet why this is, but figured it is best to document the facts as I found them…

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.