Javascript examples for jQuery:Form Checkbox
get the html code for all radios/checkboxes within a form
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.js"></script> <script type="text/javascript"> $(function(){/*from w w w . jav a 2s .c om*/ var htmlarr = []; $("input[type='radio'][name='radio123'],[type='radio'][id='radio123']").each(function () { htmlarr.push($(this).clone().wrap('<div>').parent().html()); }) console.log(htmlarr); }); </script> </head> <body> <input type="radio" id="radio123"> </body> </html>