Answer the question
In order to leave comments, you need to log in
Why doesn't e.target.dataset always work?
I have this code in render
<a title={title} key={keyVal} onClick={this.onClick} type="button" className={`control-structure pull-right ${className}`}>
<i data-key={keyVal} data-value={valueVal} data-level={level} className={`fa ${parentClassName}`} aria-hidden="true"/>
</a>
onClick(e) {
e.preventDefault();
console.log( e.target.dataset.level);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question