Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Xpath to get sidebar element of neopets
- var SideBar = document.evaluate("id('content')/table/tbody/tr/td[1]",document,null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
- //a var to create a div for clarity of code later
- var mydiv = document.createElement('div');
- var start = document.createElement('button');
- var stop = document.createElement('button');
- //Putting it all together
- SideBar.snapshotItem(0).appendChild(mydiv);
- mydiv.innerHTML = '<font size="2" face="Verdana" color="red">Buy List</font><br></br><textarea ID="blist" cols="15"rows="5"></textarea><br></br>';
- //a startbutton
- var startButton = mydiv.appendChild(start);
- startButton.innerHTML = '<button>Start</button>';
- startButton.addEventListener('click', start, false);
- //a stopbutton
- var stopButton = mydiv.appendChild(stop);
- stopButton.innerHTML = '<button>Stop</button>';
- stopButton.addEventListener('click', stop, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement