-1

I am working with JS bookmarklets and I am playing around withjavascript:document.title = "WHATEVAH". However, when I use that by itself, it removes all content on the page. So then I tried javascript:document.title = "WHATEVAH";document.body.innerHTML = document.body; but that didn't work either. Please explain what I am doing wrong, and how I can fix it.

Komali
  • 77
  • 10

1 Answers1

2

You have to return undefined at the end, otherwise it's going to navigate to a blank page. A common way of doing it is to do:

javascript:document.title = "WHATEVAH"; void 0;
Derek 朕會功夫
  • 92,235
  • 44
  • 185
  • 247