1
I really need a little help since grad school. I need to create this function:
<input type="button" value="Refresh Page" onClick="history.go(0)">
However it should be created using the method Document.createelement() and I’m not getting, already tried in several ways but I always end up with an empty input text box that does not serve for nothing and the button doesn’t even appear.
If it is not possible to create this button, a written text AGAIN clickable to refresh also serves. I tried to do and the page is in eternal Reload even before it is loaded. Taking advantage of the question, in case I change the history.go(0)
for history.go(-1)
It goes back to the previous page? Thank you very much.
To link
var ae = document.createElement('a');
var eText = document.createTextNode("AGAIN");
ae.appendChild(eText);
ae.title = "AGAIN";
ae.href = window.location.reload();
document.body.appendChild(ae);
Para Botao
var batsu = document.createElement("input");
batsu.setAttribute('type', 'button');
batsu.setAttribute('valeu', 'AGAIN');
batsu.setAttribute('onClick', 'history.go(0)');
document.body.appendChild(batsu);
Exactly what I was needing, thank you very much Virgilio and Lucas
– Kappa
@Kappa I did your way had problem in the code and now it works also take a look
– novic
AMAZING, I WAS BREAKING MY HEAD ON TIME ON THIS, THANK YOU VERY MUCH
– Kappa