How to add ondragstart event in HTML UI


Hi there,
I want to use drag&drop in HTML UI made with PlayCanvas. I find an example of what i want in my UI there :
The problem is I don’t know why I can’t use ondragstart event added by the script.
There is my script to create my drag element :

PageContructor.prototype.setupDraggableObject = function(name, id){
    var tempDiv = document.createElement('div');
    tempDiv.setAttribute('id', 'button' + id);
    tempDiv.setAttribute('draggable', true);
    tempDiv.innerHTML = "<p class=\"text-in\">" + name + "</p>";
    if (tempDiv) {
        console.log("Event added");
        tempDiv.addEventListener('ondragstart', function() {
        }.bind(this), false);


Actually, in the console, I got the “Event added” but not the “dragging” when I try to drag elements.

Did something is wrong with my code ?

Thanks for your answers.