When the user inputs any number, the number needs to be joined with the assigned text (in this case a URL). However it results in this: http://someurl.com/?value=null
. Instead of null
I expect the number the user inputted.
<head>
<script type="text/javascript">
var juarel = "http://someurl.com/?value=";
var velju = document.getElementById('somenumber');
var rezon = juarel.concat(velju);
function print() {
alert(rezon);
}
</script>
</head>
<body>
<form>
<input type="number" id="somenumber" value="">
<button type="button" id="submit" name="button" onclick="print()">SUBMIT</button>
</form>
</body>