Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- .colorz {
- padding: 2em;
- color: #fff;
- display: none;
- }
- .redcolor {
- background: #c04;
- }
- .yellowcolor {
- color: #000;
- background: #f5e000;
- }
- .bluecolor {
- background: #079;
- }
- </style>
- <div>
- <select id="colorselector">
- <option value="...">...</option>
- <option value="redcolor">Red</option>
- <option value="yellowcolor">Yellow</option>
- <option value="bluecolor">Blue</option>
- </select>
- </div>
- <div class="output">
- <div id="redcolor" class="colorz redcolor"> “Good artists copy, great artists steal” Pablo Picasso</div>
- <div id="yellowcolor" class="colorz yellowcolor"> “Art is the lie that enables us to realize the truth” Pablo Picasso</div>
- <div id="bluecolor" class="colorz bluecolor"> “If I don't have red, I use blue” Pablo Picasso</div>
- </div>
- <script>
- $(function() {
- $('#colorselector').change(function(){
- $('.colorz').hide();
- $('#' + $(this).val()).show();
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement