Question:

Javascript space between field input and word?

by  |  earlier

0 LIKES UnLike

Hey Everyone,

What i am trying to do is put space between this field input and word. I almost have it except i need to change the break to something else. i tried putting this & n b s p; in place of the break but didn't work. Just trying to put enough space in there so that i can separate 2 words to not look so close together.

<script type="text/javascript">

var upload_number = 2;

function addFileInput()

{

var d = document.createElement("div");

var l = document.createElement("a");

var file = document.createElement("input");

var text = document.createElement("input");

var br = document.createElement("br");

var des = document.createTextNode("Description")

d.setAttribute("id", "f"+upload_number);

file.setAttribute("type", "file");

file.setAttribute("name", "attachment"

+upload_number);

text.setAttribute("type", "text");

text.setAttribute("name", "description"+upload_number);

l.setAttribute("href", "javascript:removeFileInput("

+upload_number+");");

l.appendChild(document.

createTextNode("Remove"));

d.setAttribute("id", "f"+upload_number);

d.appendChild(file);

d.appendChild(br);

d.appendChild(des);

d.appendChild(text);

d.appendChild(l);

document.getElementById("more

Uploads").appendChild(d);

document.getElementById("total

Attachments").value = upload_number;

upload_number++;

}

</script>

Thank you in advance :),

Rach

 Tags:

   Report

1 ANSWERS


  1. I didn&#039;t read through your code, but the general way to do this is with css.  Use either the margin or padding property.

    If &#039;elem&#039; is your input element and you want space on the left, try this:

    elem.style.marginLeft = &quot;10px&quot;;

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions