Welcome to Assassin's Creed Wiki! Log in and join the community.
User:SlyAceZeta/common.js: Difference between revisions
Jump to navigation
Jump to search
imported>SlyAceZeta Created page with "$(document).ready(function(){ $(".wds-global-navigation__search-input").attr("placeholder", "Search Assassin's Creed Wiki..."); })" |
imported>SlyAceZeta trying out MutationObserver |
||
| Line 1: | Line 1: | ||
var mutNode = document.getElementsByClassName('wds-global-navigation__search-input')[0]; | |||
var mutConfig = { attributeFilter: ['placeholder'] } | |||
}) | |||
var mutObserver = new MutationObserver(mutCallback); | |||
function mutCallback(mutations) { | |||
for (var mutation of mutations) { | |||
if (mutation.type === 'attributes') { | |||
mutNode.setAttribute('placeholder', "Search Assassin's Creed Wiki..."); | |||
} | |||
} | |||
} | |||
mutObserver.observe(mutNode, mutConfig); | |||
Revision as of 07:37, 3 March 2021
var mutNode = document.getElementsByClassName('wds-global-navigation__search-input')[0];
var mutConfig = { attributeFilter: ['placeholder'] }
var mutObserver = new MutationObserver(mutCallback);
function mutCallback(mutations) {
for (var mutation of mutations) {
if (mutation.type === 'attributes') {
mutNode.setAttribute('placeholder', "Search Assassin's Creed Wiki...");
}
}
}
mutObserver.observe(mutNode, mutConfig);