asp.net - Moving button element to different div(parent) using JavaScript - Stack Overflow

I have a buttonon a aspx pageshould be positionedon table for one criteriaand for otherit sho

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
Add a ment  | 

1 Answer 1

Reset to default 5

Using 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745657599a4638636.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信