I have always used javascript or other javascript frameworks to use, but right now I donβt have any frameworks, so I wanted to see if anyone knows how I can do this in direct javascript, if possible.
Basically, I have a div like this
<input type="button" id="more_fields" onclick="add_fields();" value="Add More" /> <div id="room_fileds"> <div class='label'>Room 1:</div> <div class="content"> <span>Width: <input type="text" style="width:48px;" name="width[]" value="" /><small>(ft)</small> X </span> <span>Length: <input type="text" style="width:48px;" namae="length[]" value="" /><small>(ft)</small</span> </div> </div>
What I need when the "Add more" button is clicked, I basically need to add more width and length fields or create an entire structure like the one above with all divs or just insert a new span tag with fields below the existing one.
I know how to do this using jquery or a prototype structure, but unfortunately I cannot use any frameworks for this. Does anyone know how to do this. I would post iv code for this, but I donβt even know where to look.
source share