1
I have several DIVs
as the code below.
<div class="col-md-10" ordained-field="0"></div>
How do I get them all by the attribute I created ordained-field
1
I have several DIVs
as the code below.
<div class="col-md-10" ordained-field="0"></div>
How do I get them all by the attribute I created ordained-field
1
I just needed to define the type of element I want to bring and my custom attribute between brackets:
console.log($('div[ordained-field]'))
I also found a search through a custom attribute with values:
$('div[ordained-field="1"]')
Browser other questions tagged javascript jquery html5
You are not signed in. Login or sign up in order to post.
just change "ordained-field" to "data-ordained-field" to be a valid property in html.
– Wictor Chaves
https://www.w3schools.com/tags/att_global_data.asp
– Wictor Chaves