jqueryzepto

:selected in Zepto.js


I'm getting errors when doing .find("option:selected") in Zepto.js. Is ":selected" even supported in Zepto? If not, is there an equivalent way to make that work, without reverting to jQuery?


Solution

  • From skimming through the docs, I don't think so. That said, you should be able to do:

    var sel = document.getElementById("mySelect");
    console.log(sel.options[sel.selectedIndex].value);