jquery - changing to through DOM -


I am getting a piece of HTML code from a plugin and I & lt; All instances of span class want to change in the code = "post-statistics" & gt; to P class = "post-stats" & gt; What is the best way to achieve this?

Maybe replacewith () work?

  $ ('span.post-status'). Replacewith (function () {return '& lt; p class = "post-stats">' + $ (this) Html () + '';});   

Instead of doing all this, why & lt; Span & gt; a & lt; P & gt; with CSS? It should be enough by adding it to your stylesheet.

  span.post-status {display: block; }   

Or, if you insist on jQuery:

  $ ('span.post-status'). CSS ('display', 'block');    

Comments