Skip to content

Remove childs "Selected" attribute from <option> when parent is changed #65

@hja0

Description

@hja0

If your using an "Selected" attribute on a child's option: <option selected> and change the parent and then change back the parent again the child will change to the option with the selected attribute. A little bit annoying.

This little fix will remove the "Selected" attribute from the child's tag when the parent is changed.

$(document).ready(function () {
    $("#mark").change(function () {
        $("#series option:selected").each(function () {
            $(this).removeAttr('selected');
        });
    })
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions