I'm a bit stuck. I'd like to get the attribute value "for" using a jquery selector. Though I am able to successfully log to the console, how can I get/log just the value for the attribute "for" on the labels? I've tried console.log(labels['for']) but that isn't the way to go. Below is the related code.
HTML:
<div class="inline-group" id="album_set-group">
<h2>Albums</h2>
<div class="inline-related">
<h3><b>Album:</b> <span class="inline_label">#1</span></h3>
<fieldset class="module aligned ">
<div class="form-row field-name">
<div>
<label for="id_album_set-0-name">Name:</label> <input id="id_album_set-0-name" maxlength="100" name="album_set-0-name" type="text">
</div>
</div>
<div class="form-row field-release_date">
<div class="date-field">
<label for="id_album_set-0-release_date">Release date:</label> <input id="id_album_set-0-release_date" name="album_set-0-release_date" type="text">
</div>
</div>
</fieldset>
</div>
</div>
JAVASCRIPT:
$(document).ready(function() {
var labels = $( "#album_set-group" ).find( "label" );
console.log(labels);
});
loop/.each.. Use.attr(ATTR_NAME)