I’m using “onclick” on WordPress site that triggers an event. The code is:
<a onclick="$zoho.salesiq.floatwindow.visible('show');">
[tt_vector_box icon="fa-comments" size="fa-4x" color="#FF8300" link_to_page="" target="" description=""]
<h3>Customer Service</h3>
Do you have any questions?
Talk to our Live Help online service
[/tt_vector_box]
</a>
When attempting to save the code, WordPress strips the onclick object leaving:
<a>
[tt_vector_box icon="fa-comments" size="fa-4x" color="#FF8300" link_to_page="" target="" description=""]
<h3>Customer Service</h3>
Do you have any questions?
Talk to our Live Help online service
[/tt_vector_box]
</a>
How can i solve this problem?
PS. If i have to edit or add a code would you please let me know where to add it or edit it and where the file it may be?
thanks
Use a wordprtess shortcode to actually include the js code in the saved post, or as mantioned, use an external js file and target the element (using some ID) using code in this external file.
To use a shortcode do this:
Use like this (inside wordpress post):
UPDATE for edited question:
WordPress API of parsing of shortcodes will not parse nested shortcodes (those that are similar), but can parse nested shortcodes that are different according to this wordpress post (this is a known problem in wordpress with shortcodes and various plugins and libraries use their own shortcode parsing scheme to override the default behaviour)
The shortcode solution for the new question would be to create a context shortcode like this:
Use like this:
This new shortcode is custom and is created by you (it does not exist by default in wordpress). The code for the new shortcode
[link_onlick][/link_onlick]
can be put in your wordpress functions.php file (it is the file that defines custom functions for your wordpress site)