0

When I'm trying to check an options is selected using by cash-dom, it throws an error like following:

Uncaught DOMException: Element.mozMatchesSelector: ':selected' is not a valid selector

This is my code:

const options = cash('option');
options.map(i=>{
  console.log(i,options.eq(i));
  console.info(options.eq(i).is(':selected'))
})
Pejman
  • 2,442
  • 4
  • 34
  • 62

1 Answers1

0

I figure it out, just change

console.info(options.eq(i).is(':selected'))

with:

console.info(options.eq(i).is('[selected]'))
Pejman
  • 2,442
  • 4
  • 34
  • 62