$(this).find("input[name=amount]").val($(this).find("input[name=amount]").val().replace('$', ''));
Keep getting this error on my developer tools. I just want to replace the character $ with nothing which is ”
Thoughts?
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.
Your error just says that there is no element that matches your selector, so
element.val()is returningundefined, which has noreplacemethod. Try debugging it andconsole.log()at each step.Also, you don’t need to search for the element twice. Just store it in a variable: