Hi,
I need your input....
The following (Option 1) doesn't work in IE6 - I get "Item is undefined" error.
The following (Option 2) works in NS but not in IE. IE doesn't retrieve the object. I will be using this instead of Option 1 cause I will have multiple tags with the same name so I can easily change properties for each.
Code (Option 1):
<span name="Item1">Some text...</span>
<script>
Item1.style.display = "none";
</script>
Code: (Option 2):
<span name="Item1">Some text...</span>
<script>
var e1 = document.getElementsByName("Item1");
if (document.all)
{e1.style.display = "none";}
else
{e1.item(0).style.display = "";}
</script>
I hope someone can help me out with this.
I need your input....
The following (Option 1) doesn't work in IE6 - I get "Item is undefined" error.
The following (Option 2) works in NS but not in IE. IE doesn't retrieve the object. I will be using this instead of Option 1 cause I will have multiple tags with the same name so I can easily change properties for each.
Code (Option 1):
<span name="Item1">Some text...</span>
<script>
Item1.style.display = "none";
</script>
Code: (Option 2):
<span name="Item1">Some text...</span>
<script>
var e1 = document.getElementsByName("Item1");
if (document.all)
{e1.style.display = "none";}
else
{e1.item(0).style.display = "";}
</script>
I hope someone can help me out with this.

Comment