I have created a english to hindi transliteration webpage . There are rules for mapping every hindi letter to its english equivalent. If user presses 'd' , I want to suggest some nearby letters . It would be great if I am able to create & remove buttons (which have associated onclick action) using javascript. Is that possible ?
Asked
Active
Viewed 1,350 times
-2
-
10Yes, it is possible. – Adi Jul 30 '12 at 09:10
-
Yeah there are several ways you could do it, depends how you want to implement it – Troy Cosentino Jul 30 '12 at 09:12
-
2Here try this answer http://stackoverflow.com/questions/7707074/creating-dynamic-button-with-click-event-in-javascript – karmafunk Jul 30 '12 at 09:13
1 Answers
0
steve graham - that worked for creating clickable buttons with asoociated action. ALso I Used this
function removechildren()
{ var node=document.getElementById("fooBar");
node.innerHTML = "";
}
To remove all of them at once.

user1371666
- 445
- 1
- 5
- 18
-
how can I remove them one by one when name of child elements is not known ? – user1371666 Aug 01 '12 at 06:57