Link to home
Start Free TrialLog in
Avatar of willsherwood
willsherwood

asked on

JS img.match

I need help debugging a line of code that's giving an error.

function chgState (objElement)
{
...
var imgID=img.match(/(\d+)\.(gif|jpg)$/i);
...
}

call to the above function:
<span onClick="chgState(this)"><img src="images/1.gif"><input type="hidden" name="A_1" > </span>


error reported by error console

Error: img.match is not a function


any advice for how to resolve?
thanks

ASKER CERTIFIED SOLUTION
Avatar of dhiraj05
dhiraj05

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of coolersport
coolersport
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of willsherwood
willsherwood

ASKER

thanks to all!!!