jQuery Form How to - Append form controls








Question

We would like to know how to append form controls.

Answer


<!--from  w  w w  .  java2  s. c om-->
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.7.1.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    $("body").append('<p><label for="mobtel">Enter verification no.:</label><br /><input id="verification_no" type="text" name="verification_no"/></p>');
});
</script>
</head>
<body>
</body>
</html>

The code above is rendered as follows: