A lot of frameworks implement their own attributes (ng-, v-, bind-, etc.) Is there a way to select elements that have attributes starting with some string? (without looping through all elements and their properties)
You can use these methods to do this :
Let's say you have <div class="exampleDiv">, you can catch the div element with $("div:regex(class, exa.*)"). (NB: exa.* is your regex...)
$('[id^=start]') matches elements with id attribute starting with start
$('[id$=end]') matches elements with id attribute ending with end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With