How Could I correctly replace the content of a div with the contents of another div?
- div1
- div2
I want the contents of div2 to be replacing the contents of div1
$('#start').load('#start_hidden');
Join Stack Overflow to learn, share knowledge, and build your career.
Working demo http://jsfiddle.net/M4v4M/
API: .replaceWith
http://api.jquery.com/replaceWith/
Hope it fit your need :)
code
$('#div2').replaceWith($('#div1').html());