I am modifying a javascript file in which they have used the following code. Does anyone know what this does / where it is documented / etc. It appears it is creating an anchor node and giving it the inner html of “Back”, but I’m not sure how it works or what it’s capabilities are, as I need to add various attributes to the link:
$("<a id=>").html("Back");
Thanks!
jQuery is just being forgiving. Normally, the code would look like this, instead:
Which means, create an
aelement and set its inner HTML to “Back”. You can chain some attribute assignments directly after: