我有一个名为myWebsite.html的模板文件。它包含HTML模板所需的所有内容。所以它有HTML,HEAD和BODY标签。我想用JavaScript加载它,并把它放到站点上的一个div中。所以我不想要HTML,HEAD和BODY标签。该怎么做呢?
这是我需要的原型:
$val = getData('myWebsite.html');
$val = removeHTMLHEADBODYTAGS($val); //remove these tags with everything insite, also remove the body tag but leave the c
我有一些字符串形式的html。
var html = "
<html>
<head>
<title>
Some Text
</title>
</head>
<body>
<h1>
My First Heading
</h1>
<p>
My first paragraph.
</p>
</body>
</html>
";
它里面有title