C# 我想添加标签集合&;<;div class=";“表格内联线”&燃气轮机;我该怎么做?

C# 我想添加标签集合&;<;div class=";“表格内联线”&燃气轮机;我该怎么做?,c#,jquery,asp.net-mvc,asp.net-mvc-3,html,C#,Jquery,Asp.net Mvc,Asp.net Mvc 3,Html,这是我下面的代码视图 <div class="carpet bs-docs-example bs-docs-carpet"> <h4>Please Provide details about your carpetting needs </h4> <div class="form-inline"> <label class="control-label"&

这是我下面的代码视图

 <div class="carpet bs-docs-example bs-docs-carpet">

            <h4>Please Provide details about your carpetting needs </h4>


            <div class="form-inline">
                <label class="control-label"><b>Length</b></label>
                <input type="text" name="Carpet.Room.Length.Feet" id="Carpet_Room_Length_Feet" style="width: 80px" class="floor-text" />Ft
            <input type="text" name="Carpet.Room.Length.Inch" id="Carpet_Room_Length_Inch" class="floor-text" />Inch
                <label><b>Width</b></label>
                <input type="text" name="Carpet.Room.Width.Feet" id="Carpet_Room_Width_Feet" class="floor-text" />Ft
             <input type="text" name="Carpet.Room.Width.Inch" id="Carpet_Room_Width_Inch" class="floor-text" />Inch<br />
            </div>
            <div></div>
            <a href="#" class="addroom">Add Room</a> / <a href="#" class="removeroom">Remove Room</a>
            <br />
            <div class="control-group">
                @Html.Label("Removing Old flooring", new { @class = "control-label" })
                <div class="controls">
                    @Html.DropDownListFor(model => Model.Carpet.RemoveOldFlooring, new List<SelectListItem>() { new SelectListItem() { Text = "Yes", Value = "True" }, new SelectListItem() { Text = "No", Value = "False" } })
                </div>
            </div>
            <div class="control-group">
                @Html.Label("Molding", new { @class = "control-label" })
                <div class="controls">
                    @Html.DropDownListFor(model => Model.Carpet.Molding, new List<SelectListItem>() { new SelectListItem() { Text = "Yes", Value = "True" }, new SelectListItem() { Text = "No", Value = "False" } })
                </div>
            </div>
            <div class="control-group">
                @Html.Label("Stairs Included?", new { @class = "control-label" })
                <div class="controls">
                    @Html.DropDownListFor(model => Model.Carpet.Stairs, new List<SelectListItem>() { new SelectListItem() { Text = "Yes", Value = "True" }, new SelectListItem() { Text = "No", Value = "False" } })
                </div>
            </div>
            <div class="control-group">
                @Html.Label("How many Steps", new { @class = "control-label" })
                <div class="controls">
                    @Html.EditorFor(x => x.Carpet.StairSteps)
                </div>
            </div>




    </div>​
它是添加而不是删除它。
我只想添加标签中的内容,并在单击“添加房间”和“删除房间”链接时删除这些内容。

为什么不给新添加的内容一个类

$('body').on('click','a.addroom', function(e) {
     e.preventDefault();

     var $cloned = $('.form-inline:eq(0)').clone().addClass('NewlyAdded');

     $('body').append($cloned);

 }); 
然后像这样离开

 $('body').on('click', 'a.removeroom' ,function(e) {
    e.preventDefault();         
    $('.NewlyAdded').remove();
 }); ​

我可以用return false代替e.preventDefault吗?是的,你可以用它查看这篇文章。
 $('body').on('click', 'a.removeroom' ,function(e) {
    e.preventDefault();         
    $('.NewlyAdded').remove();
 }); ​