Skip to content

Instantly share code, notes, and snippets.

Last active September 14, 2017 12:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
* Function for appending multiple Usabilla InPage widget on one page based on a provided classname.
* Use this function use this function after page-load, before the function usblInPageAddCustomVarMulti and before the in-page install script.
* @param {String} classname [The name of the Class you want to us for appending the in-page widgets (no special characters or uppercase)]
* @param {String} widgetid [The ID of the widget you want to use found on]
function usblInPageAppendToClassMulti(classname, widgetid){
var faqToggleElementList = document.getElementsByClassName(classname);
var arrayLengthFaqToggle = faqToggleElementList.length;
var nodeDiv = document.createElement("div");
nodeDiv.setAttribute("ub-in-page", widgetid);
for (var i = 0; i < arrayLengthFaqToggle; i++) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment