Jump to content

User:Kevin B12/fakenewmessage.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
function killfakeUsermessage()
{
    alert("function is run");
    var divs = document.getElementsByTagName("div");
    var killbreak = 0;
    for(var i=0; (i < divs.length - 1) || (killbreak == 1); i++)
    {
      var div = divs[i];
      var id = div.id;
      if (id == "jump-to-nav")
      {
        alert("matched jump-to-nav");
        if (divs[i+1].class == "usermessage")
        {
          alert("hi");
          killbreak = 1;
        }
      }
    }
}
$(killfakeUsermessage);