Skip to content

Instantly share code, notes, and snippets.

View SilverPreece's full-sized avatar
🐀
Coding like crazy

Silver Preece SilverPreece

🐀
Coding like crazy
  • Vancouver, BC
View GitHub Profile
@SilverPreece
SilverPreece / jquery.detach-select-options.js
Created October 3, 2012 08:25 — forked from dave1010/jquery.detach-select-options.js
jQuery plugin to detach (hide) select options and add them again.
// this is because of http://stackoverflow.com/questions/4398966/how-can-i-hide-select-options-with-javascript-cross-browser/4423543
// forked from dave1010's example to include removal of attached elements from the data() array
(function($){
$.fn.extend({detachOptions: function(o) {
var s = this;
return s.each(function(){
var d = s.data('selectOptions') || [];
s.find(o).each(function() {