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.
HTMLページの上部の見出しに「色」という単語があります。イギリス英語に設定されたデバイスを使用しているユーザーの場合、テキストを「色」に変更したいと考えています。どうすればこれを達成できますか?(可能であれば最小限の Javascript で)
見出しに ID を指定すると、次のようになります。
<h1 id="myColorHeading">Color</h1>
あなたはこのようにすることができます:
var el = document.getElementById('myColorHeading'); el.innerHTML = el.innerHTML.replace('Color', 'Colour');