
creating HTML element dynamic
How about using createElement("BR") to create a couple of <BR>'s and then using appendAdjacentElement to place one after each span element...
You know you could have done all of this by building an HTML string of all three <input> elements (with ids) with <br>'s between and simply used one span. You would insert the HTML you built into the span by assigning it to the span's innerHTML property or replace the span entirely by assigning the HTML it to it's outerHTML property.
--
Michael Harris
I am tring to create a new INPUT TYPE="TEXT" dynamic (VBScript)
I have used the createElement method to do that and the <span> to put it on
the HTML,
But when I want to put a line break after the <span> (in order to put a new
element under another),
It Does not do it
What is the way to do it (To put the new Element whenever u want)?
Here is the code:
<HTML>
<HEAD></HEAD>
<TITLE></TITLE>
<FORM NAME="FrmErr">
<SCRIPT LANGUAGE=VBS>
Sub TxtCreate()
Dim ElementErrNum
Dim ElementErrDesc
Dim ElementErrReduce
Set ElementErrNum=document.createElement("<INPUT TYPE=""text"" SIZE=10>" )
Set ElementErrDesc=document.createElement("<INPUT TYPE=""text""
SIZE=10>" )
Set ElementErrReduce=document.createElement("<INPUT TYPE=""text""
SIZE=10>" )
ElementErrNum.name="txtNum" & document.all.length-12
ElementErrDesc.name="txtDesc" & document.all.length-12
ElementErrReduce.name="txtReduce" & document.all.length-12
DataNum.appendChild (ElementErrNum)
DataDesc.appendChild (ElementErrDesc)
DataReduce.appendChild (ElementErrReduce)
End Sub
</SCRIPT>
<BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF"
LINK="#000000" VLINK="#808080" ALINK="#000000">
<BLOCKQUOTE CLASS="body">
Error Number Error Description Points Reduce<BR><HR>
<SPAN ID="DataNum"></SPAN>
<SPAN ID="DataDesc"></SPAN>
<SPAN ID="DataReduce"></SPAN><BR>
<INPUT TYPE="button" value="Add " name=BtnCrt onclick=TxtCreate()>
<INPUT TYPE="button" value="Submit " name=BtnSub onclick=TxtCreate()>
<INPUT TYPE="button" value="Clear " name=BtnClr
onclick=TxtCreate()><BR><HR>
</BLOCKQUOTE>
</FORM>
</BODY>
</HTML>