0

I want to change an h4-element to an h3-element.

Is there any easy possibility with jQuery?

Of course there is the .replaceWith-function. But the content of my h3-elemtent must not be deleted.

Thanks!

Brotzka
  • 2,959
  • 4
  • 35
  • 56

1 Answers1

0

This should work

$("h4").each(function () {
    var self = $(this);
    self.replaceWith("<h3>"+self.html() + "</h3>");
});
11thdimension
  • 10,333
  • 4
  • 33
  • 71
  • Thanks, that worked fine for me. But I had to change it a little bit, because there were only three h4-titles which I wanted to change. – Brotzka Dec 14 '15 at 19:04