Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // In your HTML:
- <button class="jQButton">Purple</button>
- ...
- // In your JS file:
- $(document).ready(function() {
- $('.jQButton').click(function() {
- $('#colorDiv').css('background-color', this.innerHTML.toLowerCase());
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement