I'm using the
event.target.className
to get the ClassName, but sometimes an element has multiple class names, how can I make it,
so it only gives the first class name as outcome?
Oh, and please without jQuery.
I'm using the
event.target.className
to get the ClassName, but sometimes an element has multiple class names, how can I make it,
so it only gives the first class name as outcome?
Oh, and please without jQuery.
If you'd want target the element to which the event handler has been attached use this
event.currentTarget.classList[0]