我想在HTML页面上用法语写一个文本,并在同一个地方用英文隐藏翻译。单击JavaScript按钮将显示英文文本而不是法文文本,方法是更改包含文本的每个标记的Visibility
属性。将两个不同的文本放在HTML页面的同一个地方
也许这不是做这种事情的最好方法,但我必须这样做。
我试过以下的HTML和CSS代码:
.presentationField {
vertical-align: text-top;
margin-left: auto;
margin-right: auto;
width: 500px;
border: 2px dashed blue;
}
<div id="frenchField" class="presentationField">
<h1>Les villes du Québec</h1>
<form>
Veuillez saisir le nom d'une ville au Québec<br>
<input type="text" id="recherche">
</form>
</div>
<div id="englishField" class="presentationField">
<h1>Cities of Québec</h1>
<form>
Please type the name of a town located in the province of Québec<br>
<input type="text" id="recherche">
</form>
</div>
但它不工作:以英文文本低于法国之一,我想不通为什么。
你能发布一些你的javascript代码吗? – Khalid 2015-03-30 21:44:02