0

Hi, can anyone help me put the action of opening a link with this button?

<!DOCTYPE html> <html> <body bgcolor="green"> <form> <button id="bcen" value="Avançar" onCLick="history.forward()"> <script> document.getElementById("bcen").style.width = "100px"; //Size document.getElementById("bcen").style.height = "46px"; //Size document.getElementById("bcen").style.background ="blue"; //size document.getElementById('bcen').style.backgroundImage = "url(https://lh3.googleusercontent.com/proxy/rESDTuJNFKhbkD8VqG7PhHhnLHrlH74AFrnx1KR-aaHLqwJgGlveTLr1tAEwtFExNpSBoWQTTUu-EUHqeIn6wLo_mGWOrGNex1NzMzdtVzveod_0=w422-h195-nc)"; document.getElementById('bcen').style.backgroundSize ="contain"; document.getElementById('bcen').style.backgroundColor = "transparent"; document.getElementById('bcen').style.border = "none"; document.getElementById('bcen').style.outline = "none"; </script> </form> </body> </html>

3rd Aug 2018, 3:54 AM
Chaves
Chaves - avatar
32 Réponses
+ 4
Chaves Are you 20 Buscar ?
3rd Aug 2018, 8:33 AM
Calviղ
Calviղ - avatar
4th Aug 2018, 3:34 AM
Calviղ
Calviղ - avatar
+ 2
Congratulations! 🎉 I didn't understand your latest question, 20 Buscar .
3rd Aug 2018, 7:29 PM
Janning⭐
Janning⭐ - avatar
+ 1
I don't understand why all of that styling needs to be done in JavaScript when CSS seems to be more appropriate, but it's possible I'm missing something here. I also think that abstracting out the document.getElementById('bcen').style part would help consolidate things so it's easier to read. There are a few different ways of making the button open a link, but it seems like you already had one in mind ... just make sure your browsing history reflects that you had gone ahead to another page previously, as the caveats in this reference will remind you: https://www.w3schools.com/jsref/met_his_forward.asp
3rd Aug 2018, 10:08 AM
Janning⭐
Janning⭐ - avatar
+ 1
Calviղ No, he's my brother is helping me in the game too we are learning a lot with you thanks for the help, friend!
3rd Aug 2018, 12:56 PM
Neymar Silva
Neymar Silva - avatar
+ 1
Can you post the code to Code Playground? I am not quite clear on what you are referencing (e.g. difference between menu ready and ready game? are you saying you have two buttons? etc.).
3rd Aug 2018, 10:24 PM
Janning⭐
Janning⭐ - avatar
+ 1
20 Buscar Share your 2 sets of codes here using Code Playground.
4th Aug 2018, 1:38 PM
Calviղ
Calviղ - avatar
0
I managed to make the button that opens the link! now I wanted to make my code turn a link has how?
3rd Aug 2018, 2:35 PM
Neymar Silva
Neymar Silva - avatar
0
Janning⭐ what I meant is the following, I have a menu ready with the start button and a ready game I wanted to join the 2 type when I press start open the game how do I do it ??
3rd Aug 2018, 10:20 PM
Neymar Silva
Neymar Silva - avatar
0
I want to join the 2 when I press start open the game understood?
3rd Aug 2018, 10:27 PM
Neymar Silva
Neymar Silva - avatar
0
?
3rd Aug 2018, 10:54 PM
Neymar Silva
Neymar Silva - avatar
3rd Aug 2018, 10:54 PM
Neymar Silva
Neymar Silva - avatar
0
Calviղ do you have whatsapp?
3rd Aug 2018, 10:59 PM
Neymar Silva
Neymar Silva - avatar
0
20 Buscar I'm sorry, I can't share my phone contact on public forum. You shouldn't too. You can always get me from QnA here...
4th Aug 2018, 2:58 AM
Calviղ
Calviղ - avatar
0
ok
4th Aug 2018, 2:59 AM
Neymar Silva
Neymar Silva - avatar
0
I can't understand well about your later question. 20 Buscar Perhaps you could write it in your own language, Brazilian language? And share your Code Playground code instead for ease of debug and rewrite the codes. Don't copy and paste codes to QnA directly any more.
4th Aug 2018, 3:00 AM
Calviղ
Calviղ - avatar
0
ok então eu tava dizendo o seguinte eu quero juntar 2 codigos 1 codigo é o menu ou 2 codigo é o jogo certo? então eu queria juntar os 2 codigos em 1! tipo no menu eu tenho o botão start eu queria que quando eu apertar o botão start fosse para o segundo codigo que é o jogo!
4th Aug 2018, 3:04 AM
Neymar Silva
Neymar Silva - avatar
0
Calviղ tem como juntar 2 codigos eu criei 2 codigos que você tinha me ajudado lembra?
4th Aug 2018, 1:17 PM
Neymar Silva
Neymar Silva - avatar
4th Aug 2018, 1:39 PM
Neymar Silva
Neymar Silva - avatar
0
https://code.sololearn.com/WaSiBe7H5zux/?ref=app
4th Aug 2018, 1:39 PM
Neymar Silva
Neymar Silva - avatar