Hi i want to add page depend on button click.
and my single page means a single Div tag.
if i want to add the page(div) depend on button click
Ok. Check this. Enter position in textbox and new DIV will be added to that position
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript"> $("#btnAdd").live("click", function () { var dv = $("<div/>").html("<img src = 'http://www.aspforums.net/Avatars/VikasSingh.jpg' style = 'height:50px;width:50px' />"); $("#container div").eq($("#position").val() - 1).before(dv); }); </script> </head> <body> <form id="form1" runat="server"> <div id="container"> <div><img src = 'http://www.aspforums.net/Avatars/Mudassar.jpg?634578735955470000' style = 'height:50px;width:50px' /></div> <div><img src = 'http://www.aspforums.net/Avatars/Mudassar.jpg?634578735955470000' style = 'height:50px;width:50px' /></div> <div><img src = 'http://www.aspforums.net/Avatars/Mudassar.jpg?634578735955470000' style = 'height:50px;width:50px' /></div> </div> <input type = "text" id = "position" /> <input type="button" id="btnAdd" value="Add" /> </form> </body> </html>
Demo
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.