![]() |
Create radio button Hi friends I wrote a program that has a button on it, when I press that button the scripts activates and creates new radio buttons. The problems is that I want the radio button to be of the class draggable. I have posted my code below. Code: <script Language="JavaScript"> |
Re: Create radio button Hello If you are talking about the CSS class. Then setAttribute should work fine with your problem. I have posted the part of the code, I have not tested it. but it may help you. Code: newElem.setAttribute("class", "draggable") |
Re: Create radio button Hi Thanks for the reply. That works fine without any errors. But sorry it still does not display a radio button on the page. I am not that experienced to javascript and any advice is appreciated. Please help |
Re: Create radio button Hi I think you have to append it to the DOM when you have done creating it. I feel that the input element which you need will be in the form. It will be good rather than adding it to the body element. See the statement below Code: document.forms[0].appChild(newElem); Code: newElem.appChild(newElem) |
All times are GMT +5.5. The time now is 10:04 AM. |