我的索引页面包含弹出框。如果单击弹出框,我想用弹出框标题替换索引页标题。
例如
<title><?php echo $title?></title>
我想显示如下:
<?php
if(condition){ (->*such as #model2 is clicked*)
$title="Model2 Section";
}
else{
$title="Home"
}
?>
我使用弹出框如下: - &gt; (弹出框链接)
<article>
<a href="#modal2" class="dsnbutton ybank" id="pop_button">Model 2</a>
</article>
弹出框
<div class="remodal" data-remodal-id="modal2" role="dialog" aria-labelledby="modal2Title" aria-describedby="modal2Desc">
如何更改标题?任何想法。
答案 0 :(得分:1)
您可以使用document.title = "new title"