I have a button on a aspx page should be positioned on table for one criteria and for other it should be positioned on different div (I dont have the access to code behind for programmatic adding ) all i have to do is though javascript what would be the best way to move the button position?
<div id= "main">
<table>
<tr><td id="loginsbtbtn"></td><tr>
<table>
<div id="cbtn">
<asp:Button ID="btnSubmit" BackColor="#b5c7de" runat="server" Text='continue' />
</div>
</div>
Thanks in advance
I have a button on a aspx page should be positioned on table for one criteria and for other it should be positioned on different div (I dont have the access to code behind for programmatic adding ) all i have to do is though javascript what would be the best way to move the button position?
<div id= "main">
<table>
<tr><td id="loginsbtbtn"></td><tr>
<table>
<div id="cbtn">
<asp:Button ID="btnSubmit" BackColor="#b5c7de" runat="server" Text='continue' />
</div>
</div>
Thanks in advance
Share Improve this question edited Dec 21, 2010 at 19:18 user113716 323k64 gold badges453 silver badges441 bronze badges asked Dec 21, 2010 at 18:26 GrasshopperGrasshopper 1,8186 gold badges29 silver badges49 bronze badges 2- can you give us a code snipplet – qwertymk Commented Dec 21, 2010 at 18:30
- <div id= "main"> <table> <tr> <td id="loginsbtbtn"> </td> <tr> <table> <div id="cbtn"> <asp:Button ID="btnSubmit" BackColor="#b5c7de" runat="server" Text='continue' /> </div> </div> – Grasshopper Commented Dec 21, 2010 at 18:43
1 Answer
Reset to default 5Using jQuery, do this:
$('#myButton').appendTo('#someDiv');
Without jQuery, do this:
document.getElementById('someDiv').appendChild(document.getElementById('myButton'));
This assumes the targeted elements have ID attributes. Impossible to give an exact solution without any HTML in the question.