MediaWiki:FindNEdit/code.js

var searchWord; var addBefore; var addAfter; if(document.getElementById('mw-content-text').innerHTML.search(searchWord) > -1) { var brokenText = document.getElementById('mw-content-text').innerHTML.split(' '); brokenText[brokenText.indexOf(searchWord)] = addBefore + brokenText[brokenText.indexOf(searchWord)] + addAfter; $('#mw-content-text').html(brokenText.join(' ')); }