PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, August 3, 2022

[FIXED] How to select and attach event handler to visual composer element using jQuery?

 August 03, 2022     jquery, visual-composer, wordpress     No comments   

Issue

I have a task to generate option using ajax in visual composer element, but when I try to select the element and attach an event using jQuery.. I can't trigger the event. Below is the jQuery script that I used to select the visual composer element.

jQuery('.post_id').on('change', function(){ console.log('Changed'); });

OR

jQuery(document).on('change', '.post-id', function(){ console.log('Change'); })

This is the screenshot of the visual composer element that I want to select using jQuery.

enter image description here

Thanks.


Solution

replace '.post_id' to '[name=post_id]'



Answered By - diavolic
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing