Clickable Div Binding - Wrap or Using JS?

I have a rather complicated list of Dynamic Div classes that contain various neighboring divs to display the contents of the store - all this should have a hang state and be clickable (currently it is used on guidance models) and is accessible.

I believe that I can either approach this path -

1 - Compose the containing div in the anchor link and style accordingly

2 - Fix the anchor tag in the div class and write a JS function to trigger a click on the anchor when the contained div is clicked.

What are the thoughts on the right approach?

+3
source share
2 answers

<a>, tabIndex=0, role=link, JavaScript, .

, "" - , <div> <button>, , . ( , role=button <a>)

:hover, :focus

+4

, <div> , onclick. "" ARIA (, role = "button" role = "link" ), "tabindex" (tabindex = "0" ), .

+3

All Articles