I want to extract filename with path and its extension separately from image’s src with jquery.
for example:
<img src="images/cat/kitty.gif" id="myimg" />
I need to get “images/cat/kitty” and “.gif” from above code.
how can I do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can simply use
attrmethod instead:If you want name and extension separately, you can do: