I want to use the javascript function getElementsByClassName to loop in some html divs that don't have the exactly class name, but it starts with the same text: "akordeon-item"
So, the html text looks like this:
<div class="akordeon-item akordeon-item-first">
<div>
<span class="userid">
blabla@yahoo.com
</span>
</div>
</div>
<div class="akordeon-item akordeon-item-second">
<div>
<span class="userid">
john_doe@yahoo.com
</span>
</div>
</div>
<div class="akordeon-item akordeon-item-third">
<div>
<span class="userid">
john_doe2@yahoo.com
</span>
</div>
</div>
<div class="akordeon-item akordeon-item-fourth">
<div>
<span class="userid">
john_doe3@yahoo.com
</span>
</div>
Also, the javascript code I tried is this one:
var slides = getElementsByClassName(".akordeon-item");
for(var i = 0; i < slides.length; i++)
{
alert("element : "+slides[i]);
}
I also tried searching for this string inside the getElementsByClassName method : "akordeon-item"
How can I make this loop work? Please help...