I am trying to target the parent node, which is a div of a link tag(a) in my code, I have tried target.parentNode but that does not work, maybe as I am using querySelectorAll?. My code so far is:
function remove() {
var target = document.querySelectorAll('a[data-type="data"]'), i;
for (i = 0; i < target.length; i++) {
if (target.length > 1) {
target[i].remove();
}
}
}
remove();
Html:
<div class="carousel-slide">
<a data-type="data" data-type="image">
<img class="img-responsive" src="./285-603.jpg">
</a>
</div>
Any idea's?