Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1211737

    I want to change images and the content of text fields using Javascript.

    I finally determined how to change the image “src” by doing the following:

    1. Setting the developer ID on the image to “work_image”
    2. Setting the image src using the following Javascript:

    document.getElementById(‘work_image’).getElementsByTagName(‘img’)[0].src = work_image;

    I want to do the same thing to a text field by using the Developer ID. Can you tell me the Javascript I can use to change the text field contacts?

    Question: Is there a better way to do this?

    I would also then like to have the URL link of an Enfold Image to be a Javascript Function instead of a URL,, but it will only let me enter a URL. I solved this problem for now using a Javascript EventListener and setting a unique class for any image I wanted to execute the function like this:

    document.addEventListener(‘click’, function (event) {
    if ( event.target.classList.contains( ‘pic_thumb’ ) ) {
    show_work(event.target); return false;
    }
    }, false);

    Question: Is there a better way to do this?

    • This topic was modified 4 years, 7 months ago by rogersparks.
    #1212712

    Hey Roger,

    Can you please explain why you need to do this? We need to understand the use case.

    Best regards,
    Victoria

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