在jQuery noConflict()中选择元素

时间:2013-12-16 18:53:06

标签: jquery

jQuery中的这一行与$一起使用。

$fname=$(":file:nth-of-type(" + $i + ")").val();//this is working in jquery

但是当我转换为 noConflict 模式时,以下行不起作用:

 $fname=jQuery(":file:nth-of-type(" + $i + ")").val();//this is not working

我的代码是:

jQuery(document).ready(function () {
    jQuery(document).on("change", "#iefile456", function () {
        $nod=jQuery("#item1");
        $i =1;
        while($nod.html() != "" ){
            $nod=$nod.next();
                $i=$i+1;
            }
            alert($i);
        $fname=jQuery(":file:nth-of-type(" + $i + ")").val();
        alert($fname);
    });
});

alert($i)正在运作,但alert($fname)无效。

0 个答案:

没有答案