Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<nav id="navigation" data-role="navigation">
<li><a href="#" class="link">HTML</a></li>
<li><a href="#" class="link">CSS</a></li>
<li><a href="#" class="link">Javascript</a></li>
<div id="#playground">
<li><button data-selector="#navigation">document.querySelector('#navigation')</button>
var buttons = document.querySelectorAll('#playground button');
var len = buttons.length;
for (var i = 0; i < len; i++) {
// utilisation de la méthode `NodeList.item`
var button = buttons.item(i);
#navigation {
margin: 0 auto;
padding: 0.5em 0;
background-color: rgb(247, 26, 49);
text-align: center;
ul {
padding: 0;
list-style-type: none;
li {
display: inline;
margin-right: 2em;
a, a:visited, a:hover, a:active {
color: white;
text-decoration: none;
a:hover, a:active {
cursor: grab;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.