Skip to content

Instantly share code, notes, and snippets.

@muzafferkoluman
Created June 29, 2017 14:37
Show Gist options
  • Save muzafferkoluman/02197119d50ebaa2777c92c12424cc1a to your computer and use it in GitHub Desktop.
Save muzafferkoluman/02197119d50ebaa2777c92c12424cc1a to your computer and use it in GitHub Desktop.
parentlerle istenilene doğru ilerlemek
<div id="div1" style="background-color: burlywood">
<p>Lorem ipsum dolor sit amet, nde voluptatem voluptates.</p>
<p>Lorem ipsum dolor sit amet, s.</p>
<p>Lorem ipsum dolor sit amet,rehenderit.</p>
<p>Lorem ipsum dolor sit amet,rehenderit.</p>
</div>
<button onclick="tikla()">Tikla</button>
<script>
function tikla() {
var parent=document.getElementById("div1");
var child=parent.childNodes[3];
child.style.color="blue";
child.style.backgroundColor="red";
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment