Dynamic HTML Attributes?

Hi,

I’m building a plugin where I need to insert a HTML element on page. That element has attributes which I would like to fill via my editor-element field inputs. How do I do this?

I’m new to coding, sorry if this is a silly question.

Here what it looks like, see the DYNAMIC-VALUE-HERE:

image

I tried putting a variable there but it does not read the variable value for some reason. I checked the variable has the right value via a console.log

image

image
also tried:
image

Hey marcuslate, instead of just declaring the appUUID inside the microphone element, you need to concatenate the strings together with a + operator.

I would try:

let myCT = $('<microphone data-uuid="' + appUUID + '"></microphone>');
1 Like

Hey that actually works, thank you so much! And welcome to the Bubble forums :slightly_smiling_face:

2 Likes