How to use a select list to show text on a page?
I have a list of films on my web page and am using a select box to allow the user to show the films by the actor they choose in the select box. However I am having trouble using the value from the select box to display the br elements with actor name. Please help am I doing the selector wrong?Ive got this to work by outputting an alert but not by showing films with the actor the user has selected.
- $(document).ready(function() {
- $("#actor").change(function() { actor is the name of my select list when this has been changed
- $("#filmlist").hide(); it hides all films
- $("br:contains(#actor option:selected)").show(); Im trying to get this to only show the br elements with the actor the user has
- }); selected from the select list.
- });