javascript - Add style to child element inside target -


currently have script adds display:block target element matching id.

document.getelementbyid(id).style.display = 'block'; 

...but want change add's style or class child div element.

you can grab child element using javascript code:

document.getelementbyid(id)[0].style.display = 'block'; 

it's accessing item inside of array.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -