We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Change the HTML attribute by setAttribute with JavaScript

Home Forums Programming Change the HTML attribute by setAttribute with JavaScript

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #58898
    Mariusz
    Customer

    Hi! I work on adding the language translation system for my configurator, and I only have one problem with it. I use tooltips by Tippy.js, and I need to set the translation for the text that appears in the tooltip. In Webflow, I’m setting an attribute with the name “data-tippy-content” and value, let’s say “Link copied” for a “Share” button. I want to change the value to “Link skopiowany!”. How can I change the value on click in Verge3D? I’ve been trying Javascript like the below but with no luck:

    `document.getElementById(‘share_copy_link’).setAttribute(‘data-tippy-content’, ‘Link skopiowany!’);

    Here you can learn more about Tippy.js: https://atomiks.github.io/tippyjs/v5/creating-tooltips/

    Attachments:
    You must be logged in to view attached files.
    #58908

    Hi,

    Perhaps they offer some API in Tippy.js which you could call. Alternatively, you could try to replace the contents of actual HTML elements generated by this framework (with innerHTML), although this would be not a very reliable method.

    Chief 3D Verger | LinkedIn | Twitter

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.