Html 脚本在主要浏览器中工作,但在IE8中不工作

Html 脚本在主要浏览器中工作,但在IE8中不工作,html,internet-explorer,Html,Internet Explorer,我有一些代码,可以在单击时添加动态输入框。在所有主流浏览器中,它都可以正常工作。但在IE8中,它什么也不做。没有报告错误,开发人员工具也没有显示错误。这段代码应该与IE8一起工作吗。谢谢 jQuery 1.7.1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 在head部分编写doctype脚本 <scrip

我有一些代码,可以在单击时添加动态输入框。在所有主流浏览器中,它都可以正常工作。但在IE8中,它什么也不做。没有报告错误,开发人员工具也没有显示错误。这段代码应该与IE8一起工作吗。谢谢

jQuery 1.7.1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

在head部分编写doctype脚本

<script type="text/javascript">
$(function() {

var MaxInputs       = 7; //maximum input boxes allowed
var InputsWrapper   = $("#INTKInputsWrapper"); //Input boxes wrapper ID
var AddButton       = $("#INTKAddMoreFileBox"); //Add button ID

var x = InputsWrapper.length; //initlal text box count
var FieldCount=1; //to keep track of text box added

$(AddButton).click(function (e)  //on add input button click
{
        if(x <= MaxInputs) //max input box allowed
        {
            FieldCount++; //text box added increment
            //add input box
            $(InputsWrapper).append('<div><input type="text" name="box_add[]'+FieldCount+'" required="required" " /><a href="#" class="removeclass"><img src="/domain/users/css/images/redclose.png" style="margin-left: 10px; margin-right:10px;" /></a><span style="margin-left:2px;font-size:10px;color: grey;">Remove</span></div>');
            x++; //text box increment
        }
return false;
});

$("body").on("click",".removeclass", function(e){ //user click on remove text
        if( x > 1 ) {
                $(this).parent('div').remove(); //remove text box
                x--; //decrement textbox
        }
return false;
}) 

});
</script>

$(函数(){
var MaxInputs=7;//允许的最大输入框数
var inputswraper=$(“#intkinputswraper”);//输入框包装器ID
var AddButton=$(“#INTKAddMoreFileBox”);//添加按钮ID
var x=inputswraper.length;//initlal文本框计数
var FieldCount=1;//跟踪添加的文本框
$(添加按钮)。单击(函数(e)//在添加输入按钮上单击
{
if(x1){
$(this).parent('div').remove();//删除文本框
x--;//减量文本框
}
返回false;
}) 
});
HTML相关代码

       <fieldset>
       <legend>Input box reference(s)</legend>
       <a href="javascript:void(0)" id="INTKAddMoreFileBox" class="btn btn-info">Add More Boxes</a><span style="margin-left:10px;font-size:10px;color: grey;">( Maximum 8 )</span>

<div id="INTKInputsWrapper">

       <input name="box_add[]" type="text" required="required />
       <a href="#" class="removeclass"></a><a style="margin-left: 14px;" href="javascript:void(0)" class="boxhelp">Help</a>

</div>
       </fieldset>

输入框参考
(最多8个)

$(AddButton)。单击(函数…当调用方不希望返回值时,为什么要使用“return false”?如果can@diodeus不确定。我在网上找到的。你有什么修改建议吗?谢谢