标记多个ID(Label Multiple IDs)

优质
小牛编辑
131浏览
2023-12-01

描述 (Description)

当多个标签描述元素时,您必须在aria-describedby属性中放置多个ID。

例子 (Example)

以下示例演示如何在Foundation中使用multiple labels

<html>
   <head>
      <title>Label Multiple IDs</title>
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
   </head>
   <body>
      <p aria-describedby = "email1 email2">Re: re: A Christmas gift for you!</p>
      <span class = "label" id = "emaill">Maximum Priority</span>
      <span class = "label" id = "email2">Unread</span>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
      <script>
         $(document).ready(function() {
            $(document).foundation();
         })
      </script>
   </body>
</html>