0

there is a div with a class designation of:

<div class="box info-box">

I am getting a section of code using AJAX, how can I replace this part using a response and jquery's replacewith method?

jQuery('.box info-box').replaceWith(data.tooltip);

doesn't seem to work

asked Feb 3, 2015 at 21:03

1 Answer 1

2

When you want to target one element that has two or more classes, you use no space and a second period, like jQuery('.box.info-box') or if you don't need both classes to be present, you can just do jQuery('.box') or jQuery('.info-box')

I suggest posting questions like this on the general Stack Exchange page, as it's not specific to Magento.

answered Feb 3, 2015 at 23:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.