Skip to content

Instantly share code, notes, and snippets.

@resarahman
Created June 11, 2016 02:37
Show Gist options
  • Select an option

  • Save resarahman/e7643899fe35e1ecc591b601a511889f to your computer and use it in GitHub Desktop.

Select an option

Save resarahman/e7643899fe35e1ecc591b601a511889f to your computer and use it in GitHub Desktop.

Revisions

  1. resarahman created this gist Jun 11, 2016.
    14 changes: 14 additions & 0 deletions scripts.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    (function() {
    var link = $('link');

    $('button').on('click', function() {
    var $this = $(this),
    stylesheet = $this.data('file');
    link.attr('href', stylesheet + '.css');
    $this
    .siblings('button')
    .removeAttr('disabled')
    .end()
    .attr('disabled', 'disabled');
    });
    })();