Append hard code tag to body tag in jQuery

Description

The following code shows how to append hard code tag to body tag.

Example


<html>
<head>
<script
  src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<style type="text/css">
.changeP {<!-- ww  w . ja  v a2s.  c  o m-->
  font-weight: bold;
  color: red;
}
</style>
<script type="text/javascript">
  $(document).ready(function() {
    $("<div><p>Hello</p></div>").appendTo("body")
  });
</script>
</head>
<body>
  <form>
    <input type="radio" value="Option">
  </form>
</body>
</html>

Click to view the demo





















Home »
  jQuery »
    jQuery Example »




Animation
DOM
Event
Form
List
Select
Style
Table
Utilities