[EdLUG] Help 2

Robert McWilliam rmcw at allmail.net
Fri May 1 10:04:24 UTC 2020


On Thu, 30 Apr 2020, at 20:46, Andrew Ramage wrote:
> How do I link from one page to another using a button ?  I have a button 
> for going back a page, which calls this function onclick.
> 
> <script>
> function goback()  {
>    http://www.andrewnramage.co.uk/test.html
> }
> </script>
> 
> Nothing happens when I click the button ...

https://stackoverflow.com/questions/1226714/how-to-get-the-browser-to-navigate-to-url-in-javascript

This answer has how to navigate to another page in javascript. 

But I would recommend not doing that - making your site navigation depend on javascript makes the site unusable for anyone not using javascript. 

You can make a normal <a href="foo"> link look like a button (or anything else you might want):
https://www.w3schools.com/css/css3_buttons.aspou 

Robert
________________________________________________________
Robert McWilliam     rmcw at allmail.net    argh.technology

What do you consider to be your median achievement?



More information about the EdLUG mailing list