Yehuda Schwartz
Yehuda Schwartz

Reputation: 3503

Strange jquery/html behaivior with newer versions of chrome

I just came across a strange bug i have some jQuery that changes the text within a span element with jQuery(".price-box .price").html("$4.25 "), in the latest versions of chrome it started doing somthing wierd like this

enter image description here

this didn't used to happen and still doesn't happen on other browsers can someone please give me some insight into whats going on? also if after this is triggered i put that line into my console only one of the two strings in the element changes the other one stays as is?

Upvotes: 2

Views: 36

Answers (1)

Dan Philip Bejoy
Dan Philip Bejoy

Reputation: 4391

I think the issue is being caused by your event DOMSubtreeModified. Changing the DOM from within the event handler should be triggering it again. Try executing the html() from outside the event and see if the issue persists.

Upvotes: 2

Related Questions