Answer the question
In order to leave comments, you need to log in
Get request to the server?
There is a request
xhr.open('GET', '/about?name=5&age=27', true);
How to pass your variables instead of numbers? Let's say I have a variable:
let a = document.getElementById("btn2");
How can I send it with a Get request?
Answer the question
In order to leave comments, you need to log in
let a = document.getElementById("btn2");
xhr.open('GET', `/about?name=${a}&age=27`, true);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question