I am trying to parse some elements of a form.
I have with me the form ID/form name.
Now I want to parse through all radio buttons with name= “radio123″(or id=”radio123”).
But when I try $(this).html on each element (of a radio button)… then I get a blank value…
How do I access the HTML code for all radiobuttons/checkboxes within a form?
This is the normal behavior for jQuery.fn.html function:
This method uses the browser's innerHTML property.Look at the examples if you don’t understand what I mean.I don’t know why you want to get the HTML (if you want the value, look at the jQuery.fn.val method), but here’s a solution
Be careful with the outerHTML, as it is not supported across all browsers you could use this function: