User:LaVey Charkus Veros BeruDeJusu/common.js: Difference between revisions
Appearance
Content deleted Content added
Added 'Back to top' button. Tag: Reverted |
Undid revision 1244793508 by LaVey Charkus Veros BeruDeJusu (talk) |
||
Line 1: | Line 1: | ||
$( function () { |
|||
var elems = document.getElementsByClassName('editsection'); // *** NOTE: ClassName may need to be 'mw-editsection' instead |
|||
for (i = 0; i < elems.length; i++) { |
|||
var span = document.createElement('span'); |
|||
var link = document.createElement('a'); |
|||
link.href = '#top'; |
|||
link.appendChild(document.createTextNode('back to top')); |
|||
span.appendChild(document.createTextNode('[')); |
|||
span.appendChild(link); |
|||
span.appendChild(document.createTextNode('] ')); |
|||
elems[i].insertBefore(span, elems[i].firstChild); |
|||
} |
|||
}); |
|||
$( function () { |
$( function () { |
||
var elems = document.getElementsByClassName('editsection'); // *** NOTE: ClassName may need to be 'mw-editsection' instead |
var elems = document.getElementsByClassName('editsection'); // *** NOTE: ClassName may need to be 'mw-editsection' instead |
Revision as of 06:48, 9 September 2024
$( function () {
var elems = document.getElementsByClassName('editsection'); // *** NOTE: ClassName may need to be 'mw-editsection' instead
for (i = 0; i < elems.length; i++) {
var span = document.createElement('span');
var link = document.createElement('a');
link.href = '#top';
link.appendChild(document.createTextNode('back to top'));
span.appendChild(document.createTextNode('['));
span.appendChild(link);
span.appendChild(document.createTextNode('] '));
elems[i].insertBefore(span, elems[i].firstChild);
}
});