I have a select box
<select id="be-variants-select" class="form-control" name="tx_cart_cart[beVariants][1]" required="">
<option value="">Please choose ...</option>
<option value="5" data-regular-price="16,95 €">40 x 40</option>
<option value="6" data-regular-price="14,95 €" disabled="">60 x 30</option>
</select>
I append some text to an option value in some cases
$(document).ready(function() {
$('[disabled=""]','select.form-control').append(' - xxx');
})
The website has to languages with different URLs:
https://my-domain/.../
https://my-domain/de/.../
How do I have to extend the selector to get the opportunity for different appending text for the two languages?
window.location.hrefand then in an if/else block append different text depending on what the url iswindow.location.pathname, the same advice applies though, use the typical string manipulation methods to search the path for what you're looking forif (window.location.href.search('/de/') > -1) {}