-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathF12 forever
16 lines (15 loc) · 1.33 KB
/
F12 forever
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://stackoverflow.com/questions/1155353/find-and-replace-in-a-webpage-using-javascript
// @grant none
// ==/UserScript==
//var div = document.getElementById('answers-header');div.textContent = 'anything';
var div = document.getElementsByClassName('vote')[0]; div.innerHTML= "<div class=\"vote\">\r\n <input type=\"hidden\" name=\"_id_\" value=\"1155353\">\r\n <a class=\"vote-up-off\" title=\"This question shows research effort; it is useful and clear\">up vote<\/a>\r\n <span itemprop=\"upvoteCount\" class=\"vote-count-post \">200<\/span>\r\n <a class=\"vote-down-off\" title=\"This question does not show any research effort; it is unclear or not useful\">down vote<\/a>\r\n\r\n <a class=\"star-off\" href=\"#\">favorite<\/a>\r\n <div class=\"favoritecount\"><b>1<\/b><\/div>\r\n\r\n\r\n<\/div>";
// [0] Is responsible for element position in page
// to find by class you need use div = document.getElementsByClassName('CLASS')[0];
// usetextContent instead innerHTML to change content in div
// то что ты написал, найдёт div с id='id' и внутри него создаст новый