Sodiyc Kurniawan
Sodiyc Kurniawan

Reputation: 25

jQuery Append a <span> tag to a <h1> heading

I want to make a tag in the tag heading, for example:

<h1> example </h1>

I was cold and turn it into the following

<h1> <span> example </span> </h1>

Please help for the code manipulation.

Upvotes: 1

Views: 1641

Answers (1)

Arun P Johny
Arun P Johny

Reputation: 388406

You can use wrapInner()

$('h1').wrapInner('<span />')

Demo: Fiddle

Upvotes: 6

Related Questions