0

I am Creating one input box dynamically using javascript

Below is the Code:

var addtxt = document.createElement("input");
addtxt.type = "text";
addtxt.name = "admissionno" ;
addtxt.id = "admissionno" ;

If i add value in static way it will take using addtxt.value="11"; But am adding like this dynamically

addtxt.value=result.studentlist[j].admissionno

it will not work.please give me the idea its helpful for me.

1
  • 1
    Is there a value in result.studentlist[j].admissionno? Commented Apr 11, 2014 at 8:36

1 Answer 1

1

Try this:

document.getElementById("admissionno").value = (result.studentlist[j].admissionno);
Sign up to request clarification or add additional context in comments.

1 Comment

@user2996174 Good to hear. Would be great if you accept this as answer :-)

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.