I want to remove value from URL(window.location) without page refresh and add value in URL without reloading the page.
I used history.pushState()
but i can't get perfect output.
history.pushState(null, null, '28');
This is base URL
https://www.example.com/color/27-28/fruits/1-2
NEW URL (Remove value) :- https://www.example.com/color/27/fruits/1-2
NEW URL (Add value) :- https://www.example.com/color/27-28-29/fruits/1-2
How to do it?
Please help me.
Thanks in advance :)