scratch – Blame information for rev 125
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
125 | office | 1 | $(function() { |
2 | $('input, select').on('change', function(event) { |
||
3 | var $element = $(event.target), |
||
4 | $container = $element.closest('.example'); |
||
5 | |||
6 | if (!$element.data('tagsinput')) |
||
7 | return; |
||
8 | |||
9 | var val = $element.val(); |
||
10 | if (val === null) |
||
11 | val = "null"; |
||
12 | $('code', $('pre.val', $container)).html( ($.isArray(val) ? JSON.stringify(val) : "\"" + val.replace('"', '\\"') + "\"") ); |
||
13 | $('code', $('pre.items', $container)).html(JSON.stringify($element.tagsinput('items'))); |
||
14 | }).trigger('change'); |
||
15 | }); |