Ecommerce Shopify WordPress Discussion

In a WordPress installation, JQuery simple script does not seem to work

I have a wordpress website and i want to add a class "myclass" to all anchor elements with JQuery. This wordpress installation does not have any plugin enabled, so its a default installation. I enqueue TEST.js file with the following command at the bottom of the functions.php file of my theme (Hello Elementor) add_action( 'wp_enqueue_scripts', 'add_my_script' ); function add_my_script() { wp_enqueue_script('jquery'); // Explicitly telling wordpress to load jquery wp_enqueue_script( 'fixamea', // name your script so that you can attach other scripts and de-register, etc. get_template_directory_uri() . '/TEST.js', // this is the location of your script file array('jquery') ); } And the file TEST.js is the following jQuery(document).ready(function($){ $('a').addClass('myclass'); console.log("running"); }) The console log "running" appears but the class 'myclass' is not added to any Anchor elements. What could be wrong?
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.