Testing code that changes the DOM on page load
I think the real issue you are trying to solve is how to test code that has reach over the whole document. Just judging by your small snippet of code, you appear to be at least using "classes". Regardless of how you've written your application, you want to put yourself into this position when unit testing DOM manipulations:

describe("Something", function() {
    var div, something;

    beforeEach(function() {
        div = document.createElement("div");
        something = new Something(div);
    });

    it("modifies the DOM", function() {
        div.innerHTML = [
            '&lt;form onsubmit="submit()"&gt;',
                '&lt;label for="fieldPassword"&gt;Password&lt;/label&gt;',
                '&lt;input type="password" id="fieldPassword"&gt;',
                '&lt;input type="hidden" name="username"&gt;',
                '&lt;input type="submit" id="btnEnter" onclick="click()" value="Enter"&gt;',
            '&lt;/form&gt;'
        ].join("");

        something.removeElements();

        expect(div.querySelector("form").onsubmit).toBe("");
        expect(div.querySelector("label")).toBe(null);
        expect(div.querySelector("input[type=password]")).toBe(null);
        expect(div.querySelector("input[type=hidden]")).toBe(null);
        expect(div.querySelector("input[type=submit]").onclick).toBe("");
    });
});


The code under test should have access to some sort of root element, which it then operates on. The beforeEach in your tests would create a new DIV tag, and a new instance of the object you want to test. This class should take the DIV tag as a constructor argument, ideally, but in the very least assign it as a property. Then your test is completely isolated from the rest of the DOM tree. There is no need to clean up these elements because they are all disconnected from the main document.

function Something(element) {
    this.element = $(element);
}

Something.prototype.removeElements = function() {
    this.element.find("#LoginForm").attr("onsubmit", "");
    this.element.find("#btnEnter").attr("onclick", "");

    // Modify form inputs.
    this.element.find("label[for=fieldPassword]").remove();

    this.element.find("#fieldPassword").remove();

    this.element.find("input[name=username][type=hidden]").remove();
};