I need to get information about certain fields in an HTML tag. "Field"
may be the incorrect term, but what I mean is the information stored in
"thing" or "widgetId" in the HTML tag below.
<div dojoType="Button" thing="foo" id="bar"
widgetId="theButton2">Grumble, grumble...</div>
I have Javascript listener in an HTML web page. On an event, a
function call in invoked, and in this function:
var curEvent = event || window.event; //either browser
var sourceEl = curEvent.tft || curEvent.srcElement; //either browser
I am interested in finding the name (in string format) of the DOM
element that generated the event. I iterate though the objects in
"sourceEl" until I find "parentElement". I am satisfied that I have
found the "parentElement" object that corresponds to the button that
generated the event, but what I cannot do from here is access the
fields in this tag. Trying to dereference the fields like
thing/id/widgetId with a dot operator only yields "undefined".
Do those those fields even exist at the time that I'm attempting to
read them?
Thanks.