How can I extract the image number from a string using the sub-string function?
I have applied the sub-string function to the property below. It returns 3 at the end in Chrome, but it does not work properly in Mozilla.
Issue : After "-->", when I check in Chrome everything looks fine. However, in Mozilla, instead of getting 3.jpg on the third step, I get .jpg
alert("obj.back is "+obj.style.backgroundImage);-->url(http://localhost/final.21/img/img3.jpg);
origImg = obj.style.backgroundImage.split(")")[0];
alert('origImg is'+origImg); -->>url(http://localhost/final.21/img/img3.jpg
alert('after length '+origImg.substring(origImg.length-5)); -->3.jpg
origImg = origImg.substring(origImg.length-5).split(".")[0];
alert('origImg is'+origImg); --> 3