Firstly, I don't know if this title is correctly and tell what I really want. I have html form with many elements ex. div, p or js. For example:
<div id="main">
<div id="abc1"></div>
<div id="abc2"></div>
<style>.module a {min-height: 25px;padding-left: 95px;}</style>
<form id="myForm">...</form>
<script>...</script>
</div>
I want to change order or two elements: abc1 and abc2. In js I have:
$(document).ready(function(){
$('#main').each(function (index, element) {
var html = '';
html += '<div id="abc2">'+ $(element).find('#abc2').html() +'</div>';
html += '<div id="abc1">'+ $(element).find('#abc1').html() +'</div>';
$(element).html(html);
});
});
This works. But the problem is that I need to include each element from div#main. It is possible to include other without write each of one in javascript ?
Kind regards