[Solved] Create a link while typing using Jquery [closed]


Although I do not want to make it your habit to take SO as a code for me site but this time here it is for you:

var field = document.getElementById("field");
var link = document.getElementById("link");
field.onchange = function() {
    link.href = "http://www.example.com/?q=" + encodeURIComponent(field.value);
    console.log(link.href);
};

Notice I did not code it for you in jQuery, I would like you to change it for yourself, if you want to.

4

solved Create a link while typing using Jquery [closed]