jQuery can't affect "outside" divs -


so, want simple thing:

$('#addform').html(donedata); 

the div #addform <div> , donedata variable. won't work , kinda think know why. in case want affect div i'm in. so, after clicking submitbutton, want change contents of addform , replace them variable donedata.

for better understanding:

<div id="addform"> <div id="form"> <input type="text" value="blabla" /> <input type="submit id="submit" value="submit" /> </div> <div id="result" style="visibility:hidden"> </div> </div> 

if change first line of code (in beginning of post), wouldn't try change #addform, content of #result (first make visible via css-method) works fine.

so, problem simply, can't change of div "i'm in" or there else do?

i'm not sure if wrote understandable.

i think you're trying replace #addform contents of donedata, presumably string of html.

you can jquery method replacewith. removes element in selection (in case, #addform) document , replaces new content (in case donedata).

$('#addform').replacewith(donedata); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -