javascript - using html() to get changed content -
i have div need grab html contents of (so naturally use html())...
however, text fields. whenever grab contents of div (that contains text fields), grabs initial html , not data changed end user...
here js bin version..change input field, run function , see take initial value of field...
any way around this?
http://jsbin.com/oleni3/5/edit
try out ^
the code:
$(document).ready(function() { $('div#top input').change(function() { $(this).attr('value', $(this).val()); }); $('#click').click(function() { var _curhtml = $("div#top").html(); $("div#bottom").html(_curhtml); }); });
Comments
Post a Comment