Amoraboti - Program
Rashed - Uz - Zaman (Rasel)
Home
About Me
Brainstorming
Facebook Fan Page
Contact
Author
I'm
Rz Rasel
From
Bangladesh
Archives
April 2010
May 2010
January 2011
February 2011
January 2012
February 2012
March 2012
Current
Previous Posts
Changing Form Input (Textbox) Style on Focus using...
Duration Calculator Between Two Dates
Get Cursore Position In JavaScript
Hide And Prevent Copy Of Web Content Using JavaSri...
Hide All Content Of Website Using JavaScript Html Css
Ajax Post Method
Ajax getting xmlhttprequest to loop continuously
Show Message In Cursor Pointer
Resizing images with PHP
JavaScript Blinking Title
My Link
Islam And We
My Diary (Bangla)
My Diary (English)
My Lyrics (Bangla)
My Lyrics (English)
My Poem (Bangla)
My Poem (English)
My Story (Bangla)
My Story (English)
General Knowledge
Fun And Jokes
Lyrics (Bangla)
Lyrics (English)
Lyrics (Hindi)
Quotations
Dynamically add button, textbox, input, radio elements in html form using Js
Friday, February 11, 2011
<HTML>
<HEAD>
<TITLE>Rz Rasel</TITLE>
<SCRIPT language="javascript">
function add(type) {
//Create an input type dynamically.
var element = document.createElement("input");
//Assign different attributes to the element.
element.setAttribute("type", type);
element.setAttribute("value", type);
element.setAttribute("name", type);
var foo = document.getElementById("fooBar");
//Append the element in page (in span).
foo.appendChild(element);
}
</SCRIPT>
</HEAD>
<BODY>
Dynamically add button, textbox, input, radio elements in html form using JavaScript.
<FORM>
<H2>Dynamically add element in form.</H2>
Select the element and hit Add to add it in form.
<BR/>
<SELECT name="element">
<OPTION value="button">Button</OPTION>
<OPTION value="text">Textbox</OPTION>
<OPTION value="radio">Radio</OPTION>
</SELECT>
<INPUT type="button" value="Add" onclick="add(document.forms[0].element.value)"/>
<span id="fooBar"> </span>
</FORM>
</BODY>
</HTML>
posted by Rz Rasel At
11:05 AM
,
0 Comments:
Post a Comment
<< Home
Problem In Font
Download then zip file unzip and install in your system. Or normal font file just install in your system font folder. Rz Rasel
Bangla Font
Bangla Font
Find Me In Facebook
aaaa
aaaa
Copyright © 2010 - Amoraboti - Program. ® All right reaserved. Design and developed by:-
Rz Rasl
Post a Comment