-
Notifications
You must be signed in to change notification settings - Fork 5
Common Custom JavaScript for GTM
Lauren Ancona edited this page Feb 13, 2017
·
1 revision
Note: must be wrapped in a <script>
tag if used in a custom HTML tag
function() {
var list = document.querySelector('select[name="sort"]');
return list ? list.options[list.selectedIndex].value : undefined;
}
where markup is:
<select name="sort" class="sortDropdown">
<option value="BestMatch" selected="selected">Best Match</option>
<option value="LowestPrice">Lowest Price</option>
<option value="Rating">Rating</option>
</select>