开发者

Capture modified DOM content of completed form

开发者 https://www.devze.com 2023-03-18 20:35 出处:网络
I am trying to capture the modified HTML of a form to save it for later use. I ideally would like a string that have \"checked\" and \"selected\" attributes on radio button/ dropdowns that the user ha

I am trying to capture the modified HTML of a form to save it for later use. I ideally would like a string that have "checked" and "selected" attributes on radio button/ dropdowns that the user has selected. I am using jQuery and I thought I could do a simple $('form').html() on the form and it would return me the form HTML with the new user input开发者_Go百科ed values, but it returns me the original HTML with no user input.

How can I create a string of HTML from the filled out form that reflects the user's changes?


I thought I'd take a wack at this just for educational purposes... You could bind all appropriate events to actually edit the DOM:

http://jsfiddle.net/jkj4h/

0

精彩评论

暂无评论...
验证码 换一张
取 消