Examine the following:

The “Here is some sample text” might be there but not always. What you then want to check is whether the inner html of $(‘.item’) is equal to the link item alone. Since .html() returns a string representation of the html and $(‘.item-of-interest’) returns a jQuery object, you will have to find a way to convert this object to a string representation. The easiest way to do this is by using the following code:

You temporarily create an element to which you append the .item-of-interest, then you request the inner html of it.

Door Kasper