Passing value to header .js file in esp8266

I have made an webserver using esp8266 and html+css+javascript
Now I am generating some random numbers in esp8266 & want to display in webpage, but I can’t find any way to passing that number from .ino file to html or javascript header file.

.ino file :

#include <ESP8266WiFi.h>        
#include <WiFiClient.h>    
#include <ESP8266WebServer.h>
#include "htmls.h"          //Our HTML webpage contents
#include "jss.h"  //Our javascript  contents
//extern int value = 5;
#include "csss.h"      //Our css contents

ESP8266WebServer server(88);    //Webserver Object

void handleRoot() {
 String s = htmlM; //Read HTML contents
 server.send(200, "text/html", s ); //Send web page

void jsCode() {
 String s = javascriptM; //Read JS contents
 server.send(200, "text/html", s ); //Send web page

void cssCode() {
 String s = cssM; //Read CSS contents
 server.send(200, "text/html", s ); //Send web page

const char* ssid = "xxxx";  //Enter SSID
const char* password = "0000"; 

void setup() {
  Serial.begin(115200);                                             //Open Serial connection
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {    //Wait for connection

  Serial.println("Waiting to connect…");


  //If connection successful show IP address in serial monitor
  Serial.print("IP address: ");
  Serial.print(WiFi.localIP());  //Print the local IP / IP address assigned to your ESP

  server.on("/", handleRoot );                     //Define the handling function for root path (HTML message)
  server.on("/javascriptM", jsCode );
  server.on("/cssM", cssCode );

  server.begin();                     //Start the server

void loop(void) {

  server.handleClient(); //Handling of incoming requests


htmls.h file :

const char htmlM[] PROGMEM = R"=====(

        <link rel="stylesheet" href=\cssM>
          // rest of html codes
         <script src=\javascriptM></script>

jss.h file:

const char javascriptM[] PROGMEM = R"=====(

var value = 2;
function arValue(a) {
  var i = 0
  alert("Arduino values are showing"+a);

Now please help me to send value from .ino to html or js file.
Either state a way of passing parameter from .ino to html or js OR state a way of accessing a variable declared in js file from .ino (i have already tried ‘extren’, it won’t work.)
Please help me to reduce my headache.

Your variable lives in the arduino memory, getting it to the web page means triggering an http request including the variable’s value either embedded in the URL or as a POST.

If you use Ajax, a bit of JavaScript and play with the DOM you can update a specific part of your page without a full reload.

I have a French tutorial using SPIFFS and AJAX that will walk you through some ideas and for example display A0 value in a gauge and the status of a pin and a button (with a refresh rate driven by the web page)

If you don’t read French, maybe google translate on my tutorial page will help you get most of the idea....