jQuery: Add Button to div#Buttons

red5 UtahCommunity Member Qubie ✭

Is there a simple way to add a custom button to the #Buttons div? I'm sure I saw a post with jQuery or Qualtrics Javascript API instructions, but now I can't find it.


Best Answer

  • red5
    red5 UtahCommunity Member Qubie ✭
    Accepted Answer

    Found the article. This code adds a test button. The value attribute is what displays as the button's text.

    Qualtrics.SurveyEngine.addOnload(function() {
    jQuery('#Buttons').append('<input id="TestButton" class="NextButton Button" title="Test Button" type="button" name="TestButton" value="TestButton" data-runtime-disabled="runtime.Disabled" data-runtime-aria-label="runtime.ariaLabel" data-runtime-hide="runtime.Hide" aria-label="Test Button">');

    Here is the original article with a different example of using jQuery to append and clone:

    Note: you might need to add css to make the appended button look like the others.