All pastes #204437 Raw Edit

Mine

public text v1 · immutable
#204437 ·published 2006-10-15 23:25 UTC
rendered paste body
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en" dir="ltr">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>[title]</title>
		<script type="text/javascript">
			function createForm()
			{
				var parent = document.getElementById("makeformhere");
				var theForm = document.createElement("FORM");
				theForm.setAttribute("id","newForm");
				
				var btn1 = document.createElement("INPUT");
				btn1.setAttribute("type","button");
				btn1.setAttribute("value","button 1");
				btn1.setAttribute("onclick","alert('you clicked button 1');");
			
				var btn2 = document.createElement("INPUT");
				btn2.setAttribute("type","button");
				btn2.setAttribute("value","button 2");
				btn2.setAttribute("onclick","alert('you clicked button 2')");

				var textnode = document.createTextNode("your text here....");

				theForm.appendChild(textnode);
				theForm.appendChild(btn1);
				theForm.appendChild(btn2);
				parent.appendChild(theForm);
			}

			function removeForm()
			{
				var parent = document.getElementById("makeformhere");
				var theForm = document.getElementById("newForm");
				parent.removeChild(theForm);
			}
		</script>
	</head>
<body>
create a new form by clicking <a href="javascript://" onclick="createForm();return false;">here</a>
<hr>
<div style="padding:10px;height:400px; width:700px; background-color:yellow;" id="makeformhere"></div>
<hr>
remove the new form by clicking <a href="javascript://" onclick="removeForm();return false;">here</a>
</body>
</html>