unique section link text

This commit is contained in:
Heydon Pickering 2017-08-05 11:05:05 +01:00
parent 141d057adf
commit f95f76dff4
3 changed files with 5 additions and 3 deletions

View File

@ -68,7 +68,8 @@
var link = document.createElement('a')
link.setAttribute('href', '#' + id)
link.setAttribute('aria-label', 'link for this section')
var headingText = heading.textContent
link.setAttribute('aria-label', 'To this ' + headingText + ' section')
link.innerHTML = '<svg aria-hidden="true" viewBox="0 0 50 50" focusable="false"> <use xlink:href="#link"></use> </svg>'
container.appendChild(link)

File diff suppressed because one or more lines are too long

View File

@ -68,7 +68,8 @@
var link = document.createElement('a')
link.setAttribute('href', '#' + id)
link.setAttribute('aria-label', 'link for this section')
var headingText = heading.textContent
link.setAttribute('aria-label', 'To this ' + headingText + ' section')
link.innerHTML = '<svg aria-hidden="true" viewBox="0 0 50 50" focusable="false"> <use xlink:href="#link"></use> </svg>'
container.appendChild(link)