Jump to content
RAGE Multiplayer Community

How to Client side edit text html


Thelastkiss
 Share

Recommended Posts

Yes.

HTML page:

<!DOCTYPE html>
<html>
  <head>
    <meta name="Content-Type" content="text/html; charset=utf-8" />
  </head>
  <body>
    <div id="editdiv">Some word &amp; example</div>
  </body>
</html>

 

JS:

let menu = mp.browsers.new('package://realliferpg/index.html'); // start of CEF (HTML)
menu.execute(`document.getElementById('editdiv').innerHTML="Hello!"`);

After this executing this script with this HTML in block with id="editdiv" text will be this: Hello!

menu.execute is executing methods in CEF

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...