holden321
holden321

Reputation: 1183

Jquery - Create a LINK tag

var doc=$("<tag><another><link>Hello</link></another></tag>");
console.log(doc.html());

Returns:

<another><link>Hello</another>

Expected:

<another><link>Hello</link></another>

http://jsfiddle.net/holden321/22DBU/

Upvotes: 0

Views: 110

Answers (1)

RobF
RobF

Reputation: 2818

The link tag is used for defining a relationship between the document and an external source, for example a stylesheet. It is a void element and does not have a seperate closing tag.

If that's not the tag you're after, when you say link, do you mean to use the anchor tag?

Upvotes: 2

Related Questions