Skip to content

Instantly share code, notes, and snippets.

@sambenne
sambenne / optgroup.js
Created July 27, 2019 10:03
Show the OPTGROUP value with the selected value
$('select').each(function () {
if($(this).find('optgroup').length === 0) {
return;
}
$(this).bind("change blur", function () {
let opt = $(this).find(':selected');
let sel = (opt.text().split(' - '))[0];
let og = opt.closest('optgroup').attr('label');
@sambenne
sambenne / .sublime-keymap
Created December 4, 2012 10:46 — forked from jbrooksuk/.sublime-keymap
Sublime Text Insert Numbers
[
{ "keys": ["ctrl+alt+n"], "command": "prompt_insert_nums" }
]