Skip to content

Instantly share code, notes, and snippets.

@colabottles
Created January 7, 2020 01:58
Show Gist options
  • Select an option

  • Save colabottles/dd08f2ce54081618121c05a662e248c2 to your computer and use it in GitHub Desktop.

Select an option

Save colabottles/dd08f2ce54081618121c05a662e248c2 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/fabogin
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
div{
background: green;
color: white;
margin-bottom: 1rem;
padding: 1rem;
}
.red{
background: red;
color: black;
text-transform: uppercase;
}
div[data-snack="cashews"]{
background: purple;
}
.blue{
background: blue;
}
</style>
</head>
<body>
<div>Look at my div!</div>
<div class="red">Just look at it!</div>
<div data-snack="cashews">Look at all the divs!</div>
<div class="blue">Aren't they great?!</div>
<script id="jsbin-javascript">
var el = document.querySelector('div');
var elRed = document.querySelector('.red');
var elCashews = document.querySelector('[data-snack="cashews"]');
var elNone = document.querySelector('.blue');
</script>
<script id="jsbin-source-css" type="text/css">div{
background: green;
color: white;
margin-bottom: 1rem;
padding: 1rem;
}
.red{
background: red;
color: black;
text-transform: uppercase;
}
div[data-snack="cashews"]{
background: purple;
}
.blue{
background: blue;
}</script>
<script id="jsbin-source-javascript" type="text/javascript">var el = document.querySelector('div');
var elRed = document.querySelector('.red');
var elCashews = document.querySelector('[data-snack="cashews"]');
var elNone = document.querySelector('.blue');
</script></body>
</html>
div{
background: green;
color: white;
margin-bottom: 1rem;
padding: 1rem;
}
.red{
background: red;
color: black;
text-transform: uppercase;
}
div[data-snack="cashews"]{
background: purple;
}
.blue{
background: blue;
}
var el = document.querySelector('div');
var elRed = document.querySelector('.red');
var elCashews = document.querySelector('[data-snack="cashews"]');
var elNone = document.querySelector('.blue');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment