javascript - Detect elements with attribute without value -


lets i've got

<div class="some-class" selected></div> 

i'm trying if has attr 'selected', but

$(".some-class").attr("selected") //undefined $(".some-class").is("*[selected]") // false 

am able if has selected attrbute if has no value?

try use has attribute selector @ context,

$(".some-class").is("[selected]") 

demo


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -