jQuery Add/Remove Input Fields

A script that uses event delegation and the .live() method for adding and deleting extra input form fields.

by Web Developer

HTML

<h2><a href="#" id="paketLight">Light</a></h2>
<h2><a href="#" id="paketStandart">Standart</a></h2>
<h2><a href="#" id="paketVip">Vip</a></h2>   <br><br><br><br>

<div id="wrap">
    <h3></h3>
</div>

CSS

h2 a  {
    display: block;
    position: relative;
    float: left;
    margin: 10px;
    padding: 5px;
    font: 18px Arial;
    background: blue;
    color: #fff;
    text-decoration: none;
}
form input {
    margin: 5px;
    padding: 5px;
}

h3 {
    width: 200px;
    height: 30px;
    margin: 0 0 0 5px;
    outline: 1px solid #ccc;
}

JavaScript

$(function() {
    $('h2 > a').click(function(){
        $('#wrap h3').?('?');
});