I am new to JavaScript coding with html and the things that's bugging me right now is passing a variable to another page in java script. So my codes for the first page are:
<html>
<head><title>lol1</title></head>
<body>
<form action="lol2.html">
<input  type="text" name ="firstname" placeholder="First Name">
<input  type="text" name="lastname" placeholder="Last Name">
<input  type="Submit" value="Submit" >
</form>
</body>
</html>and second page are:
<html>
<head>
<title>
lol2
</title>
</head>
<body>
<script>
    var queryString = decodeURIComponent(window.location.search);
    var queries = queryString.split();
    document.write(queries); 
</script> 
</body>
</html>After I enter the value in the text box it takes me to the second page but the result is shown like this:
so how do i get rid of the "firstname=" and "Secondname="? or find an effective way to solve problem.

 
     
     
     
    