Javascript 画外音不是在读我在文本框中输入的内容
下面是我的代码:Javascript 画外音不是在读我在文本框中输入的内容,javascript,html,electron,voiceover,Javascript,Html,Electron,Voiceover,下面是我的代码: <form> <div class="form-group loginFormGrp"> <label class="caption">Backup Cloud</label> <div class="custSelect loginSelect"> <label class="caption">Server U
<form>
<div class="form-group loginFormGrp">
<label class="caption">Backup Cloud</label>
<div class="custSelect loginSelect">
<label class="caption">Server URL</label>
<input type="text" aria-label="Server URL" name="serverUrl" class="form-control" placeholder="example.server.com" value="">
</div>
<div class="form-group loginFormGrp">
<label class="caption">Email</label>
<input type="text" aria-label="Email" name="email" class="form-control" placeholder="user@example.com" value="">
</div>
<div class="loginBtnRow">
<button tabindex="0" type="submit" class="lgBtn btn btn-primary btn-block">Continue</button>
</div>
</div>
</form>
备份云
服务器URL
电子邮件
继续
每当voiceover突出显示输入文本字段时,它会显示“您当前在文本字段中,在web内容中。若要在此字段中输入文本,请键入。若要退出web区域,…”
当我开始打字时,它什么也没说。
并查看了其他应用程序或网站,其中显示了我正在键入的内容。
但就我而言,这不是阅读。
如果有人知道解决方案,请提供帮助。将
title
属性添加到输入元素并提供其他文本
向输入元素添加aria标签
,也应由屏幕阅读器选择
提供有关不同浏览器和屏幕阅读器如何处理这些属性的详细信息。我不确定这是否有用,但每次用户修改文本字段时,您可以尝试更新字段
值
属性。诸如此类:
document.querySelectorAll('input[type="text"]').forEach(function(v){
v.addEventListener('input', function(){
v.setAttribute('value', v.value);
});
});
但我希望有人能提供更好的答案,而不使用额外的JavaScript。您的代码看起来很好。我尝试了一个名为ChromeVox的chrome插件,除了将lang属性添加到父html标记中,并将所有内容包含在body标记中之外,一切似乎都很好
<html lang="en-US" style="height: 100%;">
<body>
<form>
<div class="form-group loginFormGrp">
<label class="caption">Backup Cloud</label>
<div class="custSelect loginSelect">
<label class="caption">Server URL</label>
<input type="text" aria-label="Server URL" name="serverUrl" class="form-control" placeholder="example.server.com" value="">
</div>
<div class="form-group loginFormGrp">
<label class="caption">Email</label>
<input type="text" aria-label="Email" name="email" class="form-control" placeholder="user@example.com" value="">
</div>
<div class="loginBtnRow">
<button tabindex="0" type="submit" class="lgBtn btn btn-primary btn-block">Continue</button>
</div>
</div>
</form>
</body>
</html>
备份云
服务器URL
电子邮件
继续
尝试使用title属性,但不起作用。还尝试删除aria标签。无法工作我的应用程序在电子设备中您使用的浏览器是什么?HTML在呈现时也会改变吗?字段上是否有任何验证(如jQuery验证)?通过使用普通html,您可以在最新的Safari和Chrome中使用它。Firefox没有,但这似乎是Firefox的问题。正如你提到的,这是一个电子应用程序,我可以知道你的操作系统得到这个问题。