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)
- Theme Javascript.php Overwritten Nightly [closed]
- Menu jumping when calling it via PHP
- How to get javascript slider to work! [closed]
- Theme Customizer not loading JS for live preview
- Post thumbnail to append post content via ajax click event
- Would to use AJAX to get an option from the database and use it in a jquery setup or is there an alternative to consider?
- Using page-id-{ID} from body_class() in local dev, versus live staging
- Custom theme, contact form 7 & fast secure form doesn’t work
- Enqueued JavaScript is not working
- Get the amount of posts on a given page
- Javascipt issue on custom theme
- 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
- WordPress theme resource won’t load over VPN
- pass wordpress template directory into ajax url call
- theme-independent CSS/JS files
- Twenty Fifteen: Change navigation menu behavior
- how do i develop a global nav and local nav to be wordpress dynamic?
- jQuery from parent theme loaded with many other scripts in a single min.js file
- Javascript development in Custom Themes
- Theme development: menu links a tabbed page with page jumps
- 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
- getBoundingClientRect() showing different values on load vs scroll
- wordpress script_loader_tag in function.php
- How to diagnose wp-env environment problem
- how can i remove js file from my footer in wordpress
- How to properly use AWS SES for a contact form?
- Programatically Created Menu not Editable in Dashboard
- Does single webpage do not need navigation to create a slug in permalink?
- White screen of death on index.php page 3 and above?
- 3 Level Menu Navigation (3rd Level not displaying)
- 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
- Customizer Image-Picker Preview Not Working
- Does any JavaScript file load automatically for index.php file?
- How to achieve this navigation style in wordpress navigation
- how to add jquery to wordpress
- Fallback dosen’t work when not using ‘menu’ attribute
- jQuery conflict in WordPress, works fine in HTML
- How to add drop symbol to parent nav items which have child
- WordPress 3.9 two menus in same position?
- Flexslider not working for my custom theme WordPress
- FitVid not working for iframes on particular theme install
- Strict Standards Error bootstrap navwalker
- Theme customizer live preview JS- Trying to bind to an html image url without luck
- 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
- enqueue script if page is not equal to
- wp_deregister_script was called incorrectly
- Paginated WP_Query doesn’t return 404’s, even when posts don’t exist
- Using wp_enqueue_script with social media buttons?
- How to convert that page to a wordpress template? [closed]
- wp_enqueue_script causes page to vanish
- WordPress Subpages Fancybox Trouble
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- How to make navigation a list without a plugin? [duplicate]
- What is The Best Way to Make Parallax header effect for wordpress theme ?? pure CSS or using JavaScript? [closed]
- Javascript as Jquery Function Call?
- WP site makes mobile browser crash for high memory usage