0

I have a column of input boxes and have a button for the last row to add more input boxes below the last input box. Is there a best way to do this ?

1
  • Are you using jQuery, or do you want to do this using just normal JavaScript? Commented Oct 10, 2010 at 15:13

1 Answer 1

1

You can go about something like this:

function addTextBox()
{
  var container = document.getElementById('container');
  var txt = document.createElement('input');
  txt.type = 'text';
  txt.name = "my name";

  container.appendChild(txt);
}

In the above code, container is supposed to be your column id which contains text boxes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.