How can I get values of UI elements using jQuery? | XM Community
Skip to main content

The usual jQuery syntax does not work when I try to get values of HTML elements. What syntax works in QX actually?

I found some example for actually working syntax. Actually the syntax which works actually is e.g. for the example below

is like

 


Try adding the below to the question’s JavaScript in the OnReady section:

var qid = this.questionId;
var statement1 = document.getElementById("header~"+qid+"~1");
var statement1text = jQuery(statement1).text().trim();
console.log(statement1text);

 


@Tom_1842 Thx a lot for the fast response. jQuery is working just fine for me right now.


Leave a Reply