Ancestors

Written by Elsental on 2024-11-25 at 09:18

I'm trying to change the text of a web page that doesn't have an assigned ID.

I can't use HTML or script tags.

I can only do custom #CSS and custom raw #Javascript. Can someone help me here?

I can change the text in CSS and JS without any problem when there is an ID. But of course, if the text doesn't have an ID, I have to go back to find an ID, and that deletes things in a block

Here for my example, I would like to change only "Powered by " and keep the rest.

=> View attached media

=> More informations about this toot | More toots from Elsental@shelter.moe

Toot

Written by Elsental on 2024-11-25 at 09:21

I've been offered this before. But it doesn't work :

document.addEventListener('DOMContentLoaded', function () {

    const span = Array.from(document.querySelectorAll('span'))

      .find(el => el.textContent.trim() === 'Powered by ');

    if (span) {

      span.textContent = 'New text';

    }

  });


$(document).ready(function() {

const span = $('span').filter(function() {

return $(this).text().trim() === 'Powered by ';

});

if (span.length) {

span.text('New text');

}

});

=> More informations about this toot | More toots from Elsental@shelter.moe

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113542856604938620
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
261.460584 milliseconds
Gemini-to-HTML Time
0.724158 milliseconds

This content has been proxied by September (3851b).