+ 11
How do you get the button to take you to a different page?
I have created the button but I don't know how to make it go onto a different page.
24 Respostas
+ 3
Can you add an image - I am new to this and am not sure what that means
+ 3
Jayakrishna can you simplify that, I am only on level 2 or 3 (I haven't checked recently).
+ 3
Who still uses jQuery?
+ 2
Ok, so how do I do it, PyNon?
+ 2
Thanks Solomoni Railoa. Sorry o didn't reply sooner - I was playing Solitaire
+ 1
Ex:
Use target attribute value as _blank or _top
<button onclick="nw()" target="_top">
Martial Arts
</button>
<scrip>
function nw(){
document.write("added image") ;
;}
</scrip>
change scrip to script tag
edit:
Rhia add this above code in your html body tag..
and see
a button has added target property and on click, it calls nw() function which creates a image and a output or what ever you add..
+ 1
I always seem to mess it up though. 😅
+ 1
<button onclick="window.location='./path or example.com';">click here</button>
Rhia I think this one is the easiest way to implement button with link.
because if we use <a href="#"> in the button, sometimes underline will added automatically in the button text.
+ 1
jQuery is your best friend.
+ 1
<a href="you page link here"><button>type the info here</button></a>
I hope this helps
+ 1
<!-- This is an example of a "button", it's a link element but styled, don't need scripts, only html and css: -->
<DOCTYPE html>
<html>
<head>
<style>
a {
color: white;
background-color: #337;
border-radius: 5px;
padding: 10px;
}
</style>
</head>
<body>
<a href"https://www.google.com">Go to Google</a>
</body>
</html>
0
<!DOCTYPE html>
<html>
<head>
<title>Shamanozii</title>
</head>
<body>
<button onclick="nw()" target="_top">
Click on
</button>
<sct>
function nw(){
document.write("New Html file");
};
</sct> //modify this to script tag and check
</body>
</html>
edit:
check this above code by modifying <sct> tag to script tag and see..
is that what you trying? Rhia
0
Use button, anchor tag and target a blank page. If I'm not mistaken. <button><a href="youPagehere">More info</a><button>
0
<button><a href="your Page" target="blank_">More info</a></button>
0
Sorry it's not my subject 😅
0
Use a hyperlink
0
Make a button with span or other elements inner one <a> tag . Then in href attribute of a put your target link .
0
ok