Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hja0 opened this issue Oct 31, 2017 · 0 comments
Open

Comments

@hja0
Copy link

hja0 commented Oct 31, 2017

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');
        });
    })
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant