5
Używam jQuery 1.3.2 ale mam zaktualizowany do najnowszej wersji:
Poniższa nie działa z najnowszą wersją jQuery - co tu jest nie tak?
var input = $(this);
// get the associated label using the input's id
var label = $('label[for=' + input.attr('id') + ']');
//get type, for classname suffix
var inputType = (input.is('[type=checkbox]')) ? 'checkbox' : 'radio';
// wrap the input + label in a div
$('<div class="custom-' + inputType + '"></div>').insertBefore(input).append(input, label);
// find all inputs in this set using the shared name attribute
var allInputs = $('input[name=' + input.attr('name') + ']');
dzięki zadziałało :) – user1177860
Oznacz jako odpowiedź zaakceptowana następnie :) –
Niż! Uratowałeś mi trochę czasu. Od wersji 1.8.0 wymagane są podwójne cytaty ... – nightcoder