0

i have a url string and i am wondering how to change the order=desc part into order=asc when Iuse a link on a page?

http://localhost/en/search?city=Paris#order=desc

when i click on a link e.g.

<a href="#">Change order</a>

the url would change into

http://localhost/en/search?city=Paris#order=asc

franticfrantic
  • 2,511
  • 3
  • 17
  • 14

1 Answers1

2

Simply include the fragment identifier (the part after the #) in the link (href attribute).

<a href="#order=asc">Change order</a>
MrWhite
  • 43,179
  • 8
  • 60
  • 84