I have wrapped 16 buttons each with div tags. Plus there are other child elements in the div tags.But when I use javascript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I have wrapped 16 buttons each with div tags. Plus there are other child elements in the div tags.But when I use javascript

To select the parentelement of each button using querySelectorAll the console gives me a value of undefined: here is the prototype code <div> <p>...</p> <p>...</p> <button></button> <button></button> </div> I need to use the last button to access the parent element, but it is giving me quite a problem. The above div tags are 16 just to be clear, hence 16 buttons. Anyone want to help.You can create a code with maybe two or three divs.

1st Aug 2019, 11:40 AM
prime omondi
prime omondi - avatar
1 Answer
0
Actually I have done it, but still I need a less taxing way to do it.
1st Aug 2019, 12:06 PM
prime omondi
prime omondi - avatar