Use variables in loop which have html elements using javaScript
<p>I am creating form that have 2 div each div has 1 label and 1 text box.how i can use  created label and textbox variables in for loop . guide me.</p>

<p>labels and textboxes </p>

<pre><code>var lbl1 = document.createElement(Label);
lbl1.innerHTML = "First Name";


var lbl2 = document.createElement(Label);
lbl2.innerHTML = "Last Name";


var elm1 = document.createElement(InputElement);
elm1.setAttribute("type", "text");


var elm2 = document.createElement(InputElement);
elm2.setAttribute("type", "text");

var signUpForm = document.createElement("form");
signUpForm.setAttribute("id", "signUpForm");

document.body.appendChild(signUpForm);
var getSignUpForm = document.getElementById('signUpForm');
for(var i = 1 ; i&lt;= 2;i++)
{
    Div = document.createElement("div");
    for(var j=1;j&lt;2;j++)
    {
        Div.appendChild("lbl"+j);
        Div.appendChild("elm"+j);
        getSignUpForm.appendChild(Div);
    }
}
</code></pre>

<p><code>"lbl"+j</code> takes as a string not as elemt</p>