This question already has an answer here:
I want to set the draggable attribute of my list item to be true every time the button is clicked but theres an error.
const startDrag = function(){
const li = document.getElementsByClassName('newLi')
li.setAttribute('draggable', "true");
startDraggable();
}
Error
TypeError: li.setAttribute is not a function