User talk:Atelaes/highlightSense.js

From Wiktionary, the free dictionary
Latest comment: 13 years ago by Msh210 in topic finding the right element
Jump to navigation Jump to search

formatting the wrong element?[edit]

Please see [[template talk:senseid]].​—msh210 (talk) 19:39, 13 July 2010 (UTC)Reply

finding the right element[edit]

Currently if (hash.indexOf('-') > -1) includes e.g. [[chen#Anglo-Norman]]; perhaps substitute for

if (hash.indexOf('-') > -1) {
targetSense = document.getElementById(hash);
targetSense.setAttribute('style', 'background-color:#DEF');
}

this:

if (hash.indexOf('-') > -1) {

targetSense = document.getElementById(hash); if (targetSense.className.indexOf('senseid')>-1){ targetSense.setAttribute('style', 'background-color:#DEF');}

}

?​—msh210 (talk) 19:45, 13 July 2010 (UTC)Reply