I am gettings TypeError: 'undefined' is not a function (evaluating 'document.getElementByClassName("selceted")')
when trying to get the class name or ID of the div. and I cannot figure out why. The array/nodelist is NOT empty, it has ALL the data in from every timeline-item
post, and only 1 has the class of selected
so how do I get only that element?
Here is my code so far:
if($.inArray(postdate, post_image_dates)){
var posts = $(".timeline-item");
posts.removeClass("selected");
var matchedPost = posts.filter("[data-date='" + postdate + "']");
if(matchedPost.length > 0){
matchedPost.addClass("selected");
var more_post_content = document.createElement('div');
more_post_content.id = 'more_post_content';
var ul = document.createElement('ul');
var li = document.createElement('li');
li.innerHTML = '<a href="#"><img src="' + postdata + '"/></a>';
ul.appendChild(li);
more_post_content.appendChild(ul);
var elementArray;
elementArray = [].slice.call(matchedPost, 0);
console.log(elementArray);
if($.inArray('selected', elementArray)){
var select = document.getElementByClassName("selceted");
}
}