Greetings to all! In the html document there is an input field, into which I try to transfer the name value, I get the error Cannot read property 'val' of null

I will be glad to any help.

jQuery("a#source-link").on("click", function(event) { event.preventDefault(); var link_title = jQuery(this).attr("name"); $("input#target-textfield").val(link_title); }); 
  • This code can not throw this error, can you make a working example that will reproduce the error here in the snippet or on jsfiddle.net ? - Grundy
  • what other libraries are connected besides jQuery? Check what is really equal to $ ? - Grundy
  • Understood, $ replaced on jQuery, looked through. - Leonid Smirnov
  • and what really was $ ? - Grundy

0