I need to be able to click the button and have its parents array number returned so that i can apply a style to only one of the many divs with the same class name, i would like to do this in vanilla javascript if possible.
<div class="contentBox">
<button onclick="expand()" class="contentBoxButton"> + </button>
<title>Lorem Ipsum Here</title>
<p>
Lorem Ipsum HereLorem Ipsum HereLorem Ipsum HereLorem Ipsum HereLorem Ipsum
</p>
</div>
<script>
function expand(){
var button = document.getElementsByClassName('contentBoxButton');
var parent = button.parentNode;
parent.style.height = '200px';
}
</script>