New answers tagged

0

Here's a one-liner that also plays nice with dodgy user input (say, injecting ]" into the #selectVal field, which would break Andy E's approach. function setSelect() { $("#mySelect").val($("#selectVal").val()).val($("#mySelect").val()); $("#selectVal").select(); } Why this works: the first call to $("#mySelect").val(...) selects the option if it ...


1

I think we need to start with a list of suffixes that can be put somewhere accessible(preferably as a property to a class, but global space works for now) const suffixes = [ 'master', 'utlan', 'totaloversikt' ]; From there we can change our event listener to make a note of the suffix and register a generic function for the event. suffixes....


Top 50 recent answers are included