Many developers creates elements programatically. Reference the selector by it's own path is not good in this case. So, the selector property could receive the element itself instead only receive the path string.
const element = document.createElement('button');
el.innerHTML('Click Me')
$.contextMenu({
// Allow the selector be an Element or JQueryNode Element
selector: element // or $(element), to make it easy for the implementation with JQuery
})
document.body.appendChild(element)
Many developers creates elements programatically. Reference the selector by it's own path is not good in this case. So, the selector property could receive the element itself instead only receive the path string.