Adding a line break
I'm very new to JS and just playing around with some basic stuff, so far I have;
This just creates up to 10 text boxes when the user presses the button. However, the text boxes are placed side by side until they have to go on to a new line.
var currentTxtBx = 0;
var txtBxTable = document.getElementById('txtBoxTable');
var newTxtBx = document.createElement('input'); // creates the text box element
newTxtBx.type = 'text'; // declares the text box as text
newTxtBx.name = 'check'+(currentTxtBx+1); // declares the value of the text box
alert('cannot add more than 10 boxes');
How would I go about creating and inserting a line break so that after each text box a line break would occur so that they're all place one below another?
I'm totally guessing, here:
nah that didn't work
I'm no wiz myself, but you could try creating a new variable with a line break?
var myLineBreak = "<br />";
and then just call it where necessary?
Well you could style them, or add a line break.
Great wit and madness are near allied, and fine a line their bounds divide.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)