Drag and drop UI javascript

Been looking around for a while now, I’m trying to click a 3d object in game and drag it to a UI element, had a look at the Event trigger system, not sure how to get ‘drop’ to work or ‘pointerUp’ isn’t good since it only works if the mouse doesn’t leave the area.

Using a raycast to select the item but not sure how to drop it on the UI

My drag and drop tutorial should help. It’s C#, but the principles are the same