Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
困惑しました。親切な人々が私を助けてくれることを願っていました...
ゴール:
jQueryを使用して、次のすべての出現を追加しようとしています:
<pre> ... </pre>
と:
<pre><code> ... </code></pre>
$('pre').wrapInner('<code>');
参照:wrapInner
jsFiddle の例
.wrapInner()を使用します
$("pre").wrapInner("<code></code>");
$('pre').html('<code>'+$('pre').html()+'</code>');