作为标题,如何使用 javascript 或 jquery 框架删除 html 标题上的 div? 我知道这听起来很奇怪,但目前我正在处理 CMS 模板并且生成的标题围绕着标题
<title><div id="title">Title of the page</div></title>
感谢任何帮助
最佳答案
做:
// get the title from the div and apply to the title tag and then remove div
$('div#title').parent().html($(this).text()).remove();
关于javascript:如何删除标题上的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3153611/