It's possible to set multiple using dataTransfer?

HTML

<tr class="notfirst"
    draggable="true"
    ondragstart="drag(event, '@Model.getFormat(item)', '@Model.getColor(item)')"
    ondragover="allowDrop(event)"
>

JS

function drag(ev, format, color) {
    ev.dataTransfer.setData("text", format);
    ev.dataTransfer.setData("text", color); 
}

I can correctly pass format and color to my JS function but I cant add both to dataTransfer because color replaces format. I tried also to pass an object but didn't work either.

Related posts

Recent Viewed