How to move data from HTML Element to Bubble

Hi! I have a html element that contains an array of texts that a user has clicked on in the element. I need that array of texts to be converted to bubble as a list, so I can update the user’s profile with the texts they have clicked on. How can I convert a variable from a script to a bubble variable?