
While clicking on button I want to add that 4 lables and textboxes below the panel.that 4 controls should recreate in each button by using javascript. I am new to the javascript.Please help me..
Hope this work and you never mind jQuery I guess
$('.button').on('click', function(){
$('.appnd-class').append("<label> Name </label> <input type='text'/><label> Age </label> <input type='text'/><label> Address </label> <input type='text'/><label> Office </label> <input type='text'/>")
});
You create them before. As default you set their visibility as "hide". In the button action you call a javascript function, which sets the visibility as visible.
Just answer, if you need more direction for this.
Try below
<div id="div1"></div>
<input type="button" id="mybutton" />
javascript
$(document).ready(function () {
$("#mybutton").click(function () {
document.getElementById("div1").innerHTML="<input type='textbox' />"
});
});
Like this you can add what all controls you want in your Ui
If you need pure javascript then
<div id="div1"></div>
<input type="button" id="mybutton" onclick="myfun()"/>
then javascript
function myfun()
{
document.getElementById("div1").innerHTML="<input type='textbox' />"
}
if you need to arrange the output shown in picture then you need to include your label and textbox inside a table. then it will looks like that