var audioFormats = ["mp3"] function updateOptions() { var format = $("#format").val() if (audioFormats.includes(format)) { $("#audioOnly > input").attr("disabled", false) $("#videoAndAudio > input").attr("disabled", true) } else { $("#audioOnly > input").attr("disabled", true) $("#videoAndAudio > input").attr("disabled", false) } } $(document).ready(() => { updateOptions() $("#format").on("change", updateOptions) $("#quality").val(Cookies.get("quality") || "720") $("#trim").prop("checked", Cookies.get("trim") == "true" || false) $("#playInBrowser").prop("checked", Cookies.get("playInBrowser") == "true" || false) $("form").submit(() => { Cookies.set("quality", $("#quality").val()) Cookies.set("trim", $("#trim").prop("checked")) Cookies.set("playInBrowser", $("#playInBrowser").prop("checked")) }) })