Within Avada wordpress builder I can add php elements to a page, but I want those php elements to accept input from javascript code on other parts of the site. Right now I have a post request in javascript
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://website/postRequests", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({
value: "test value"
}));
And php code for accessing said request
document.getElementById('comparison_1').innerText = $_GET['https://website/postRequests?value'];
I'm not sure how to link the two together. How do I send the post request to a different part of the site that uses php code if said php code is lying behind Avada?