Greasy Fork is available in English.

Discussies » Ontwikkeling

User script making

§
Geplaatst: 15-11-2021

How to write user script to replace a number value in my website... Example:

There is a section called price money in my website. There are 6 prices.

1. 1000 points = 200 inr

2. 2000 points = 450 inr

So I want to decrease the first one I.e 200 inr as 100 inr

Pls help me

§
Geplaatst: 15-11-2021

give us the link or the html

NotYouMod
§
Geplaatst: 17-02-2022

How to write user script to replace a number value in my website... Example:

There is a section called price money in my website. There are 6 prices.

1. 1000 points = 200 inr

2. 2000 points = 450 inr

So I want to decrease the first one I.e 200 inr as 100 inr

Pls help me

You better leave some code here, but I'll try to help you.

Example HTML:

Shop

  • 1000 Points = 200 INR
  • 2000 Points = 450 INR
  • HTML Code link: https://privatebin.net/?01302247430c4ff4#4KqCkR19SM5dMq8CoKt4ehrWtaS1LB5tp4TPKTALHNkx

    Solution:

    document.getElementById("num1").innerHTML = "100";
    

    Explanation:
    1) We need to get element, so we're using: document.getElementById('elementId')

    2) When element selected, we're using innerHTML to change HTML: innerHTML = "100";

    Reactie plaatsen

    Log in om antwoord te geven.