How to Make OnMouseEnter/OnMouseExit work correctly with Unity UI

I have a scene that only has Unity UI elements.

the UI elements are (essentially) a list of Images, each with a Text as a child.

The Text is a word.

I then created a separate Image (background) with Text, that I want to appear when the mouse is hovering over the particular word, then disappear when the mouse is not hovering over the particular word.

Each UI item has been manually created in the scene.

The issue is that options “OnMouseEnter” and “OnMouseExit” don’t work.

using UnityEngine;
using UnityEngine.EventSystems;
    
public class MouseEnablePopupWindow : MonoBehaviour
{
    public GameObject popupWindowObject;

	private void Start()
	{
	    popupWindowObject.SetActive(false);
	}

    private void Update()
    {
    }

    private void OnMouseEnter()
    {
        print("OnMouseEnter");
        popupWindowObject.SetActive(true);
    }

    private void OnMouseExit()
    {
        print("OnMouseExit");
        popupWindowObject.SetActive(false);
    }
}

Any ideas? Thanks.

using UnityEngine;
using UnityEngine.EventSystems;

  public class MouseEnablePopupWindow : MonoBehaviour, IPointerEnterHandler
  {
      public GameObject popupWindowObject;

      private void Start()
      {
          popupWindowObject.SetActive(false);
      }

      private void Update()
      {
      }
      public void OnPointerEnter(PointerEventData eventData)
     {
         print("OnMouseEnter");
          popupWindowObject.SetActive(true);
     }
}

Don’t use OnMouseEnter for UI, instead, use OnPointerEnter.

In 2020 it is not working anymore (((
In Unity library they writing OnMouseEnter should work, but it doesnt