$(document).ready(function() {
// Select the div with the class 'radiobuttonlist'
$('.radiobuttonlist').each(function() {
// Find each input within the radiobuttonlist div
$(this).find('input[type="radio"]').each(function() {
// Get the current input
var $input = $(this);
// Get the corresponding label for the current input
var $label = $('label[for="' + $input.attr('id') + '"]');
// Create a new div with class 'radiowp'
var $wrapper = $('<div class="radiowp"></div>');
// Wrap the input and label with the new div
$input.add($label).wrapAll($wrapper);
});
});
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter