I have searched so much for this. How do I make JS make a link that goes something along the lines of example.com/index.php#number?
Example of what i mean – https://gyazo.com/428ea0c819d340a699a328baaf4c1c1f
>Solution :
Lets say that you have your base address, "http://www.example.com/index.php", what you want to do is to add a new part to the url
const base = "http://www.example.com/index.php"
let number = 42
location.href = base + "#" + number
which will redirect you to "http://www.example.com/index.php#42"