-1

Is it possible to write a script in greasemonkey that will find specific/mentioned keyword on the list of given links for example a page has 10 links and am looking for word "ramp" and on those 10links can it go and highlight the links that has word "ramp" ?

2
  • 2
    Welcome to StackOverflow! This is a rather broad question; you might want to post some code examples of what you currently have and a more detailed explanation of the problems you're facing. Thanks! Commented Jan 31, 2016 at 23:13
  • Yes that is possible Commented Jan 31, 2016 at 23:14

1 Answer 1

0

I can't comment as I don't have enough reputation. As the other say, your question should not be asked this way. I assume that you don't know Javascript, so here is a quick and dirty code that solves your issue.

"use strict";
var links = document.getElementsByTagName("a");
for (let i=0; i<links.length; i++) {
    let link = links[i];
    link.innerHTML = link.innerHTML.replace("ramp", "<span style='background-color: yellow;'>ramp</span>");
}

Now that you have the code, I advice you to spend some time on the following links: https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span

Sign up to request clarification or add additional context in comments.

1 Comment

Thank You for the support .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.