javascript - selecting second element child java-script -


alight have 4 containers, when click button in container popup shows image , heading of container clicked on worked out how image cant heading second element child in container. please note school assignment , can use html css , java-script. please no hate im new this. here code please help


document.getelementbyid('bigimage').src =   this.parentnode.firstelementchild.src;  document.getelementbyid('title').textcontent =  this.parentnode.second elementchild.textcontent; 

var element = document.getelementbyid('bigimage'); var parentelement = element.parentelement; parentelement.children[0]; // <- first child parentelement.children[1]; // <- second child 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -