How do I get the element with focus?

2586
1
08-12-2015 12:39 PM
ChrisSergent
Regular Contributor III

I am trying to get the element name in the onfocus event. I created a shorter block of code here: JS Bin - Collaborative JavaScript Debugging

But I get the error:

Uncaught TypeError: Cannot read property 'call' of undefinedk.parse @ init.js:208k @ init.js:208(anonymous function) @ onFocus.html:62ha @ init.js:22(anonymous function) @ init.js:23ia @ init.js:23fa @ init.js:23g @ init.js:25(anonymous function) @ init.js:30

And I have checked my code with Lint here: The Online Lint

Tags (2)
0 Kudos
1 Reply
ChrisSergent
Regular Contributor III

It was a jQuery issue. I should have used:  on(document.getElementById('ownerAddress'), 'focusin', getElementId);

0 Kudos