I have the following code to display the last path of previous page.
var ref = document.referrer;
var pElements = ref.replace(/\/$/, '').split('/');
var last = pElements[pElements.length - 1]
Now what i want to do is to change the dropdown-list in the new site according to the value of last since it contains 4 options with values which are equal to last (you can come from page a,b,c or d)
$("[value='last']").attr('selected',true)
I tried this but the dropdown won't change the select according to last
Hopefully you get what i mean… Sorry for my bad english. But i just want to output last in the last code-snipped, like when i come from a the code would look like:
$("[value='a']").attr('selected',true)
and the dropdown would select a
.prop('selected', 'true');instead'.attr('selected',true)'