• Resolved smohannagaraj

    (@smohannagaraj)


    <div class="wpuf-label">
         <label for="post_title">Title <span class="required">*</span></label>
    </div>
    
    <div class="wpuf-fields">
          <input class="textfield wpuf_post_title_741" id="post_title_741" type="text" data-required="yes" data-type="text" name="post_title" placeholder="" value="" size="40">

    This is the code on my form. I want to add a attribute data-tip to div-wpuf-fields.

    Please help me. Thanking You.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @smohannagaraj

    This is the example JavaScript snippet for adding an attribute to the div-wpuf.

    var wpufFields = document.querySelectorAll(".wpuf-fields");
    wpufFields.forEach(function(field) {
      field.setAttribute("data-tip", "value");
    });
    

    Regards

    • This reply was modified 7 years, 9 months ago by Mehedi Hasan.
    • This reply was modified 7 years, 9 months ago by Mehedi Hasan.
    • This reply was modified 7 years, 9 months ago by Mehedi Hasan.
    Thread Starter smohannagaraj

    (@smohannagaraj)

    Ok. But I want to get the value from the label. (Eg. Title)

    Hello @smohannagaraj,

    I have already provided you the sample code. You can change the “value” as per your requirements.

    Thanks

    Thread Starter smohannagaraj

    (@smohannagaraj)

    Sorry. Please give the code that i can straightly put it on my website. I don’t know java script very well.

    Please!

    Thank U!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Adding Tool tip using java get content from another div for input fields’ is closed to new replies.