I have an <a>
tag with a child <span>
.
<a href="# " id={"biography_process_btn" + index}
className={`${low.mb_btn} ${low.mb_btn_kn} scale set_process scout-list-
process`}
data-no={index} data-processid={k.Process.id} data-jobid=
{k.Process.job_id}
data-jobexists={k.Process.phase_alias}
onClick={handleClick}
>
<span>Text</span>
</a>
const handleClick = (e) => {
let kind = '';
console.log(e.target.classList);
}
When ever user click on anchor tag or span I have to check 'someClassName' exist in classList of anchor tag. When I am clicking on span, I am not getting the classList from anchor tag but when I click outside of <span>
and inside <a>
tag then I am getting the class List.
How can I get the list of classNames from anchor tag when handleClick is called ?