SyntaxFix
Write A Post
Hire A Developer
Questions
You can also try getting the element's onclick attribute and then passing into eval. This should work despite the big taboo over eval. I put a sample below
eval(document.getElementById('elementId').getAttribute('onclick'));