IndyFusion
Programmer
If I have code like this:
and I'm using the javascript:
var _currEl = objDOM.selection.createRange();
var myobj = _currEl.parentElement();
var myobj2 = myobj.parentElement();
alert(myobj2.tagName);
Why do I not get any script errors and absolutly nothing happens. If I alert the tagName of myobj it returns 'FONT'. I'm trying to get the parent of the FONT element to see if it is a list item. What am I doing wrong? I've searched everywhere and have been working on this very simple problem for way too long. I consider myself to be a pretty good javascript programmer, but I must be overseeing something or not understanding how the parentElement method works. I would appreciate ANY help. Thank you.
Code:
<OL>
<LI>
<FONT face=Arial color=black size=2>asdf</FONT>
</LI>
</OL>
var _currEl = objDOM.selection.createRange();
var myobj = _currEl.parentElement();
var myobj2 = myobj.parentElement();
alert(myobj2.tagName);
Why do I not get any script errors and absolutly nothing happens. If I alert the tagName of myobj it returns 'FONT'. I'm trying to get the parent of the FONT element to see if it is a list item. What am I doing wrong? I've searched everywhere and have been working on this very simple problem for way too long. I consider myself to be a pretty good javascript programmer, but I must be overseeing something or not understanding how the parentElement method works. I would appreciate ANY help. Thank you.