How to get the value from JS and add it to the div as an attribute?

Hello!
There are 4 blocks with headers and 4 buttons under them, by clicking on the button opens the contact form in popup window.
I need buttons have an attribute with the name of the block header of type <a... data-name="title">, but I have almost all u, all written in JS, and I don't know how to get the JS function header and transmit the value to the attribute button, constantly out errors in the console as I hadn't tried. Then after I will already have the attributes I will be able to poison them through the form in a hidden form (Further instructions in the video).

Link to code: https://jsfiddle.net/u1yxa4kd/
div and class which is the value of the title : eapps-pricing-table-column-title-text
The number of lines in the code in the function: 7635
Screenshot 1
5cf931dd486a8276020862.png
A screenshot of the code
5cf931f6679d2856825613.png
A screenshot of where I need to insert the title name
5cf932bee4e81151806540.png

Line of code on the button: 8128

There is a video example: https://www.youtube.com/watch?time_continue=2&v=qa...
But there had this procedure easier using PHP.

Thank you very much!
March 23rd 20 at 19:24
0 answer

Find more questions by tags WordPressJavaScript