I am using jquery 1.3.2, but I updated it to the latest version:
The next version does not work with the latest version of jquery - what is going wrong here?
var input = $(this);
var label = $('label[for=' + input.attr('id') + ']');
var inputType = (input.is('[type=checkbox]')) ? 'checkbox' : 'radio';
$('<div class="custom-' + inputType + '"></div>').insertBefore(input).append(input, label);
var allInputs = $('input[name=' + input.attr('name') + ']');
source
share