I have a plugin that generates tables based on mysql queries. The plugin generated a shortcode that I put in posts to show the tables.
Above the table there is a button that has a span. the span text is
I want to change the text from
This is my new Text. There is no way to do this in the plugin options and I contacted the developer who confirmed this.
I inspected the button and obtained its class, then I used the following jQuery:
The code works fine, except that it changes the text of that button in all the tables, which is something I don't want. I want to change the text on some buttons only, based on the content of the table.
I tried putting the shortcode inside a div tag like this:
<div class="new-class">[plugin shortcode]</div>
Then I added the class to the jQyery like this:
jQuery(".new-class.buttons-collection.buttons-colvis.DTTT_button.DTTT_button_colvis span ").text(" This is My New Text ");
But it did not work. It showed the default text
I think that the problem is that the classes in the code that worked are classes of the button itself, while I added a class to the whole table?
Any idea what is the correct way to achieve what I am trying to do?
Thanks a lot.