I fix this myself. I don’t know I’m right or wrong. In WordPress plain JS script doesn’t work. I don’t know why.
I tried to solve the above mentioned problem using jQuery and it worked. both are JS only.but still I don’t know why. I’m begineer.
check below image:
the event is added successfully:
Related Posts:
- pass object/JSON to wp_localize_script
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- How to Change CSS Variable value in Theme Customizer Live Preview
- How to correctly add JQuery in a WP theme?
- Including Javascript options
- jQuery not available to other scripts
- How to: JQuery multiple wordpress media uploader buttons in the same options page?
- My jQuery is enqueued properly. So why isn’t it working?
- How do I implement jPanelMenu?
- How to enqueue scripts properly with ES6 webpack?
- change background image on scroll
- How would I get this to work – send to post from thick box
- Set start page depending on screen width [closed]
- Theme now uses require.js and enqueue script no longer works
- jQuery Snippet Not Working on WordPress Site [closed]
- WP Customizer get control value on change
- Execute javscript when theme customizer loads (autosave issue)
- What is the preferred way to add custom javascript files to the site?
- wp_nav_menu(), how to change class?
- How to include jQuery and JavaScript files correctly?
- Add custom classes to anchor in wp_nav_menu
- Any alternate TinyMCE4 themes / subthemes?
- Strict Standards Error bootstrap navwalker
- jQuery in header or footer
- Is there a way to set the order of wp_footer hooked functions?
- Google Maps not displaying in wordpress using Google Maps Javascript API
- Trigger Customizer saving process with Javascript only
- How to alter the text of the post “Excerpt” box label in WordPress post editor?
- How to add menu support to a theme?
- How to add a section to the menus configuration, offering hard coded items?
- WordPress Google Maps in Custom Theme
- Displaying wp menus by name without using theme locations
- how to change WordPress menu markup/classes
- How to hook CSS file according to theme selection in the customizer section
- Adding wp_enqueue_media(); causes problem
- using wordpress without javascript
- .sub-menu or .children?
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- WP 3.1 upgrade breaks AutoFocus+ theme
- Difficulty loading jQuery with wp_enqueue_script
- My javascript jquery won’t work?
- WordPress is adding margins and padding to my custom menu?
- Primary navigation menu & footer not showing in category / tag page
- Implementing FancyBox
- Custom markup with wp_nav_menu based on pages
- Use second time navigation.js in underscores [closed]
- Theme Customizer not loading JS for live preview
- Enqueued JavaScript is not working
- Get the amount of posts on a given page
- How to make javascript work on theme options page
- How to register and enqueue JavaScript files without breaking plugin dependencies?
- wp_enqueue_script not working?
- JQuery undefined and Stylesheet loads in bottom along with js files
- Weirdness in jQuery supplied with WordPress
- How can I wrap all blog posts image with
- White screen when attaching css to function.php
- theme-independent CSS/JS files
- Trouble in enquing all js files under certain directory
- add jquery file if a certain page is included
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- how to hide home nav link in wordpress
- Seeting Active Nav for Bootstrap in WordPress
- Custom nav menu not showing
- How do I display a greyed out next_post_link when there is no next post
- loading javascript after jquery is loaded
- MapPress Easy Google Map in Jquery Tabs Problem
- enqueuing external and internal js and css in wordpress did not work with owl.js animate.css
- I don’t think WordPress is loading jquery or bootstrap js
- Programatically Created Menu not Editable in Dashboard
- Does single webpage do not need navigation to create a slug in permalink?
- Embedding CodePen Calorie Script – jquery error
- How to load jQuery with Ajax in WP version 5.3.2?
- Ajax Comment Upvotes – Votes don’t always register
- Infinite scroll without plugin using ajax
- How can I show a custom WordPress menu anywhere I want on my website?
- Show all menu levels except top level. How to exclude top level of a menu?
- WordPress Menu item > Sub menu Class update
- Move the social media icons to the left of a WordPress nav menu for Soledad child Theme
- Need help with adding custom wordpress menu and sub-menu
- Does any JavaScript file load automatically for index.php file?
- How to achieve this navigation style in wordpress navigation
- Fallback dosen’t work when not using ‘menu’ attribute
- jQuery conflict in WordPress, works fine in HTML
- Flexslider not working for my custom theme WordPress
- FitVid not working for iframes on particular theme install
- Strict Standards Error bootstrap navwalker
- Enable WP to accept standard jQuery code embeding between the tags [duplicate]
- WordPress custom jquery not found
- Can’t attach Javascript to theme
- Passing a location-dependent array via wp_localize_script within a shortcode
- Paginated WP_Query doesn’t return 404’s, even when posts don’t exist
- How to convert that page to a wordpress template? [closed]
- wp_enqueue_script causes page to vanish
- WordPress Subpages Fancybox Trouble
- What is The Best Way to Make Parallax header effect for wordpress theme ?? pure CSS or using JavaScript? [closed]
- Javascript as Jquery Function Call?
- How can i move my product name & price from below thumbnail to be the rollover content in Avada & Woocommerce?
- How react js and other Javascript Technologies works on WordPress plugin?
- Bootstrap 4 mobile menu not working for WordPress Development
- When trying to run build script with gutenberg (with SVG import) – Error: Plugin name should be specified