0

I'm trying to add a div right after the product's name by using append.

Here's the code I have:

var txt1 = "<div id='yotpo-bottomline-placeholder'></div>"; // This is the DIV
$('#v65-product-parent > tbody > tr:nth-child(1) > td > font').append(txt1);

The div is correctly being added right after the product's name. The problem is that this div was supposed to trigger the Star Rating Review widget. See below

enter image description here

When I add this div directly into the HTML code (before the Retail Price) it is being triggered. But I'm using Volusion so I have limited access to the HTML file that's why I need to use the append. See below

enter image description here

Help?

Fernando
  • 95
  • 10

1 Answers1

0

When you append the markup to the DOM, you are doing exactly that. Appending some HTML to the DOM.

It is likely that the star review JS you're using is triggered in the $(document).ready() event, however that appended markup does not exist in the DOM when that event is triggered.

You will need to initialise the star rating manually.

Joe
  • 4,618
  • 3
  • 28
  • 35