By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,385 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,385 IT Pros & Developers. It's quick & easy.

dynamic text box

P: n/a
How can i dynamically add text box with button clicked in javascript?

shin
Sep 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
shin wrote:
How can i dynamically add text box with button clicked in javascript?

shin


<button onclick="
var textInput = document.createElement('input');
textInput.type = 'text';
textInput.value = 'value';
document.getElementById('insertHere').appendChild( textInput);
">Click me!</button>
<div id="insertHere">
</div>

For more info see:
http://www.w3.org/TR/2000/REC-DOM-Le...Core-20001113/

Robert.
Sep 22 '05 #2

P: n/a
sk
Thx it worked!

shin

"Robert" <ro****@noreply.x> wrote in message
news:43***********************@news.xs4all.nl...
shin wrote:
How can i dynamically add text box with button clicked in javascript?

shin


<button onclick="
var textInput = document.createElement('input');
textInput.type = 'text';
textInput.value = 'value';
document.getElementById('insertHere').appendChild( textInput);
">Click me!</button>
<div id="insertHere">
</div>

For more info see:
http://www.w3.org/TR/2000/REC-DOM-Le...Core-20001113/

Robert.

Sep 24 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.