How can I fix this javascript function to be compatible with JQuery v1.11.3 ?

egoselfaxis used Ask the Experts™
I'm in the process of re-building a site that was using an old version of JQuery, and I'm noticing that since I've upgraded to JQuery version 1.11.3, .. some of the functions appear to have been deprecated ... at least 1 in particular:

For example .. this one function is throwing an error ( ie: Error: Syntax error, unrecognized expression: a.[id^='enlarge'] ):

$("a.[id^='enlarge']").each(function(i) {
	if ($(this).attr("href") != "#") {
		var thisid = $(this).attr("id").replace(/enlarge/, '');

Open in new window

How can I re-write this code snippet so that it's compatible with JQuery v1.11.3 ?

- Yvan
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015
Just looks like a typo to me. Should be without the dot:

Open in new window

Meaning anchor tags that have a id starting with the word 'enlarge'.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial