JavaScript改变元素的id

改变元素下的id

	/**
     * 改变id
     * @param element
     */
    function changeId(element) {
        element.find("span[id*='wastesList'],input[id*='wastesList']").each(function () {
            var oldId = $(this).prop("id");
            var newId = oldId.replace(/[0-9]\d*/, id);
            $(this).prop('id', newId);
        });
    }
发布了84 篇原创文章 · 获赞 77 · 访问量 17万+

猜你喜欢

转载自blog.csdn.net/lujiachun1/article/details/86690209