In this function:
function myFunction (el) {
if(!el) return;
//input <el> is DOM
var $el = $(el),
dataObject = $el.data('elementId');
//code here
}
I have this error:
"Uncaught TypeError: Cannot read property '$a' of null" in line
dataObject = $el.data('elementId');
When I comment the line
if(!el) return;
the error becomes
"Uncaught TypeError: Cannot read property '_a' of null"
I'm using jQuery 3.2.1
How can I fix this?