[英]How to: Instruct a screen reader what to read out in code
I am unsure on how to make the screenreader read out a specific message for an email input instead of just reading 'email was selected'. 我不确定如何使屏幕阅读器读出用于电子邮件输入的特定消息,而不仅仅是读取“已选择电子邮件”。
Right now when tabbing to the 'from' box, it says 'Test@gmail.com selected' when I enter Test@gmail.com into the input. 现在,当跳到“来自”框时,当我在输入中输入Test@gmail.com时,它会显示“ Test@gmail.com selected”。 I want it to say "Your email address is (read text); you may enter a different email if you would like." 我希望它说“您的电子邮件地址是(阅读文字);您可以输入其他电子邮件。” I am unsure of how to approach this without entering more elements on the page that say that text exactly. 我不确定如何在不输入页面上准确地说出该文本的其他元素的情况下进行处理。
<input role="textbox"
tabindex="0"
id="from-input"
name="from-input"
class="liberty-input col-12 disabled"
formControlName="from"
[readOnly]="true" />
you can use title attribute. 您可以使用标题属性。 Just hover over input box and type something. 只需将鼠标悬停在输入框上并输入内容即可。
$('#myid').keyup(function(){ if($('#myid').val() !== ''){ $("img").attr("width", "500"); $('#myid').attr('title', 'your email is :'+ $('#myid').val()) } })
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <input id="myid" value="" title="Your mail address">Visit our HTML Tutorial</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.