I'm trying to pass a variable from a single line field to a custom html hyperlink. My code currently is as follows:
$(document).ready(function () { var num = $(".num input").val(); var target = 'target="_blank"'; //Add this in to get link to open in new tab var link = "<a " + target + "href='http://www.wherever.com?startid=" + num + "'>This is the link</a>"; document.getElementById("q9").innerHTML = link; });
and here are the two fields I'm working with:
currently, the hyperlink is http://www.wherever.com?startid=. I am not sure why the input from the single line is not passing into the hyperlink. I've been looking at this post for help, but have just reached a point where I'm not sure how to move forward.
Thanks