R
R
runapa2022-03-16 15:54:15
JavaScript
runapa, 2022-03-16 15:54:15

Why doesn't this code work in Safari?

For some reason, this code does not work in Safari, although everything works in Mozilla and Chrome.

$(document).ready(function(){  //1
        $("#search").on("keyup", function() {  //2
            var value = $(this).val().toLowerCase();  //3
            $("#select option").filter(function() {  //4
                $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);  //5
            });
        });
    });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sasha, 2022-03-16
@userAlexander

Catch, for example, using console.log where the event ends.
I suspect line 2.
Then you will think about alternative options.
Safari updated?
Mobile or desktop?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question