I want to set all items of specific class to a specific value, but IF it has a specific attribute set, it must match a condition.
Example:
<div class="address"></div>
<div class="address" data-address-type="from"></div>
<div class="address" data-address-type="to"></div>
I want to set all address to "123 Some Address Road". However, if there is a data-address-type, only if the data-address-type is "to".
$('.address[data-address-type="to"]').text('123 Some Address Road');
The above will not change the elements where data-address-type is not defined.