Bellow is my URL and [3] is my to address, It differs when user enters different location through form, I just want first word, that is mysore ,how can i remove other things?
skc1/final.html?date=12-04-
2017&time=2&from=Bangalore%2C+Karnataka%2C+India&to=Mysore+division%2C+
Karnataka%2C+India&distance=150+km
I am using this ,but it should be changed everytime if i enter different location.
window.dest_value = dest_value.replace("%2C+Karnataka%2C+India","");