Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 645
  • Last Modified:

firefox htmlunknownelement :\

<ufoTag src="...." />

<script>
var ti, t=document.getElementsByTagName('ufoTag');
for(ti=0; ti<t.length; ti++)
{
   alert( t[ti].src ); // works in IE, returns undefined in firefox
}
</script>

so, how do i get src value ?
( and possibly not parsing whole page ? )
i'd really prefer to use src tag on unknown element, or unknown tag on unknown element

0
ed987
Asked:
ed987
1 Solution
 
KennyTMCommented:
Have you tried

t[ti].getAttribute('src')

?
0
 
nabsolCommented:
Hi
This will work

<html>
<head>
<title>Form Example</title>
<script LANGUAGE="JavaScript" type="text/javascript">
function a()
{
var ti, t=document.getElementsByTagName('ufoTag');
for(ti=0; ti<t.length; ti++)
{
   alert( t[ti].getAttribute("src") ); // works in IE, returns undefined in firefox
}
}
</script>
</head>

<body onload="a()">
<ufoTag src="abc" />
<ufoTag src="abcd" />
</html>

By Nab
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now