我有一个 ID 为 toptitle的 h1,它是动态创建的,我无法更改 HTML。
它将有一个不同的标题取决于一个页面。现在,当它是 Profile 时,我想用 jQuery 将它更改为 New word。
<h1 id="toptitle">Profile</h1> // Changing only when it is Profile
// to
<h1 id="toptitle">New word</h1>
注意: 如果文本为 Profile,则改为 New word。