jQuery won't access the correct class on the <a href>

Created on 3 December 2024, about 1 month ago

Problem/Motivation

At times, jQuery would not access the correct class on the . Instead, it would look for the child HTML class called "placeholder."

A possible solution would be to use currentTarget.

      $(once('clickTabsAction','body'))
        .on('click', '.log_tabs > a', function (e) { <---- I added > to the  click function.

          // Do not follow the link.
          e.preventDefault();
          e.stopPropagation();
          
          var log_type = $(e.currentTarget).attr('class'); <---- Changed this to e.currentTarget
          update_log(log_type);

The result now is the user can access "work log" and others tabs with greater better responses. Before it may work.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia purencool

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024