Here is my line:
myArray[i].innerText == x
Here are the values from Chrome console:
myArray[i] = “13 ml Apollo glaze sherry truffel 250ml”
x = “13 ml Apollo glaze sherry truffel 250ml”
myArray[i].innerText == x returns false
Why is this happening?
Here is how I define myArray:
myArray= $($('#myIframe').contents()).find('body#tinymce').find('p, li');
debug it, you most likely have some extra whitespace characters in it.
You probably need to trim it.
Or the HTML entities are there.
If you have a bunch of special characters, you will need to replace them all.