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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.