Skip to content

Instantly share code, notes, and snippets.

@nikkaroraa
Created November 13, 2017 18:26
Show Gist options
  • Save nikkaroraa/ca158a33c81c9f0c0dcecc31674f0327 to your computer and use it in GitHub Desktop.
Save nikkaroraa/ca158a33c81c9f0c0dcecc31674f0327 to your computer and use it in GitHub Desktop.
querySelector
<!DOCTYPE html>
<html>
<head>
<title>DOM Manipulation</title>
</head>
<body>
<p id="paraId">First Paragraph</p>
</body>
<script>
//accessing the node with id="paraId"
var firstPara = document.querySelector('#paraId');
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment