0

Hi,
I would do result loop where the only exists title attribute and how to make the result of the title attribute?
This code does not work:

<html>
<head>
<script type="text/javascript">
function ppp() 
{
      var i=0;
      for(i=0;i<9;i++)
      {      
        var idm='a' + i;
        var AttributeA=document.getElementById(idm).getAttributeNode("title");
        if (AttributeA) 
        {
          document.write("number: " + i + " - " + AttributeA.value);
          document.write("<br />");
        }
      } 
}
</script>
</head>
<body>
<ul>
<li id="a1">1</li>
<li id="a2" title="100">2</li>
<li id="a3" title="100">3</li>
<li id="a4" title="150">4</li>
<li id="a5">5</li>
<li id="a6" title="120">6</li>
<li id="a7">7</li>
<li id="a8" title="130">8</li>
<li id="a9" title="100">9</li>
</ul>
<a href="#" onclick="ppp();">click</a>

</body>
</html>
1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by piotrekw
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.