Last active
August 29, 2015 14:17
-
-
Save lettergram/dd9382e541cd3701d50f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clickHandler(e){ | |
var alertString, elem, evt = e ? e:event; | |
if (evt.srcElement) { | |
elem = evt.srcElement; | |
}else if (evt.target) { | |
elem = evt.target; | |
} | |
alertString = 'Tag=<'+ elem.tagName + '>'; | |
if(elem.hasAttribute('id')) { | |
alertString += '\\nId=' + elem.getAttribute('id'); | |
} | |
if(elem.hasAttribute('class')) { | |
alertString += '\\nClass=' + elem.getAttribute('class'); | |
} | |
if(elem.hasAttribute('name')) { | |
alertString += '\\nName=' + elem.getAttribute('name'); | |
} | |
// This calls the Qt application function webElement | |
bridgeOperations.webElement(alertString); | |
return true; | |
} | |
function init() { | |
document.onclick = clickHandler; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment