HTML CSS Javascript jQuery AJAX PHP Java MORE
Need a Website Or Web Application.Contact : +91 9437911966 (Whatsapp) Note: Paid Service

How to add HTML element using Javascript

We often need form data on the same page to send the data through AJAX. So in this example we will learn how to get value by Id Javascript.

<!DOCTYPE html>
<html>
	<body>
	<div id="new">
		<p id="p1">Student</p>
		<p id="p2">Tutorial</p>
	</div>
	<script>
		var para = document.createElement("p");
		var node = document.createTextNode("Student Tutorial is a online tutorial platform !");
		para.appendChild(node);
		var element = document.getElementById("new");
		element.appendChild(para);
	</script>
</body>
</html>


Run it yourself