If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

The problem is here: var txt = $("button.open_one").text(); Now you've got 2 buttons and button.open_one.text() will be "read more read more" or something like that, thus the second condition is executed
easy to fix, pseudocode:

Thanks for the explanation. Can you explain to me why you use the .trim method? I searched online and it seems to remove white space but I just can't see why you needed to use it. Thanks, still learning.

No reason lol. You don't really need to use .trim here. sorry i misled you Sometimes i write those things automatically, just to make sure that string has no whitespaces, but .text() should remove them anyway except for &nbsp; of course