opening and closing elementor-widget-container

You need to provide a more specific selector query. There are several methods to achieve this, but I suggest that using the sibling property is the most straightforward way if your HTML structure remains constant.

var content = button.previousElementSibling; // Immediately prior to the button

However, choosing the closest method could be a reliable approach.

var content = button.closest('.read-more-content');

error code: 523