Files
roll20-character-sheets/Savage Worlds - Graph Paper/source/scripts/preview.js
T
2020-11-10 14:47:05 +01:00

17 lines
540 B
JavaScript

// Synchronize inputs in the browser preview (not Roll20!)
$('input[type=text]').on('change', function() {
$(`input[name=${$(this).attr('name')}]`).val($(this).val());
});
$('input[type=text]').on('change', function() {
$(`span[name=${$(this).attr('name')}]`).html($(this).val());
});
$('textarea').on('change', function() {
$(`span[name=${$(this).attr('name')}]`).html($(this).val());
});
$('input[type=checkbox]').on('change', function() {
$(`input[name=${$(this).attr('name')}]`).prop('checked', $(this).prop('checked'));
});