How do I put a variable in a string in JavaScript?
Example:
$('#contactForm').animate({"marginLeft": "+=680px"}, "slow");
I would like to use in a variable instead of 680px, is there a way to do this?
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.
As with most languages that don’t have sigals, you can’t perform interpolation, you have to concatenate multiple strings.