I know it is possible to add/remove HTML elements dynamically to a web page using Javascript. I was wondering is the following possible-
My coldfusion web page has a two column table and the last row of the table has a link in the first column and the second column is blank. When user hits that link, a textarea shows up in the second column which was blank so far.
Is it possible to do this using Javascript? I went through a few links on the web and a few pointers like / did help but it seems they don't help me on my scenario.
Thanks for the help in advance.
I know it is possible to add/remove HTML elements dynamically to a web page using Javascript. I was wondering is the following possible-
My coldfusion web page has a two column table and the last row of the table has a link in the first column and the second column is blank. When user hits that link, a textarea shows up in the second column which was blank so far.
Is it possible to do this using Javascript? I went through a few links on the web and a few pointers like http://www.dustindiaz./add-and-remove-html-elements-dynamically-with-javascript/ did help but it seems they don't help me on my scenario.
Thanks for the help in advance.
Share asked Mar 16, 2009 at 15:04 ArnkrishnArnkrishn 30.5k40 gold badges116 silver badges128 bronze badges 1- It is possible, can you be more specific about why the method you looked at didn't help? – Kevin Laity Commented Mar 16, 2009 at 15:09
2 Answers
Reset to default 4For your scenario, it may not be necessary to add the element. You could instead have the element already loaded in the dom (but hidden), then fire some code to show it when the link is clicked. The javascript for that is quite simple.
function ShowTextArea()
{
var ta = document.getElementById("textareaId");
ta.style = "display:inline";
}
Certainly you could do this. I think the best way to acplish it, however, is to create the item normally as part of the page and just hide it using a css style until you want to show it via javascript, rather than creating it from scratch dynamically. This should make it easier to integrate with your server-side code.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745056952a4608723.html
评论列表(0条)