H
hgraham
Hi,
I've searched for this everywhere and can't seem to find the answer.
I'm sure this is something really simple. I have an if statement and
I need to check to see whether there is an img tag within an anchor
tag. I tried the following:
var e = document.getElementById('contentWrapper');
if (e)
{
var a=e.getElementsByTagName('a');
for (var i=0;i<a.length;i++)
{
if (a.firstChild != 'img')) <-- How do I check to see if the
anchor is an img?
{
blah, blah, blah....
Can anyone tell me what the syntax should be for the statement in
question?
Thanks!!!
Holli
I've searched for this everywhere and can't seem to find the answer.
I'm sure this is something really simple. I have an if statement and
I need to check to see whether there is an img tag within an anchor
tag. I tried the following:
var e = document.getElementById('contentWrapper');
if (e)
{
var a=e.getElementsByTagName('a');
for (var i=0;i<a.length;i++)
{
if (a.firstChild != 'img')) <-- How do I check to see if the
anchor is an img?
{
blah, blah, blah....
Can anyone tell me what the syntax should be for the statement in
question?
Thanks!!!
Holli