I have a task of creating a new URL based on user input text
Name: <input type="text" id="myText" >
<button onclick="myFunction()">check tracking</button>
When using DHL service, it requires adding a specific code to the URL like this:
https://nolp.dhl.de/nextt-online-public/en/search?piececode=
and then appending the tracking code. Here is an example URL:
https://nolp.dhl.de/nextt-online-public/en/search?piececode=48484848484848484
Below is the Javascript code I have:
function myFunction() {
var inputed_code = document.getElementById("myText").value ;
var dhlurl = "https://nolp.dhl.de/nextt-online-public/en/search?piececode="
var new_url = dhlurl + inputed_code ;
window.open(new_url, "_blank");
}
However, the result is not generating a new URL. What could be causing this issue?