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 示例
$('pre').html('<code>'+$('pre').html()+'</code>');
使用 .wrapInner()
$("pre").wrapInner("<code></code>");