Solved
Unable to understand in QBuilder parameter syntax
I have the found following JS code. I'm unable to understand a couple of things:
- What is QBuilder for other than creating HTML tags inside of the JS?
- What are the last two parameters inside of the function call doing? The `{}` and the variable after it don't seem to make sense. Especially because the last param appears without square brackets in the first invocation, and with square brackets in the second invocation.
```
var messageText = 'SAMPLE TEXT';
var c = this.questionContainer;
var tc = QBuilder('span',{},messageText);
var ic = QBuilder('div',{},[tc]);
$(c).appendChild(ic);
```
Best answer by welork
@bansalpeeyush29 I asked for a clarification of QBuilder, not examples, but thank you.
I think QBuilder can be safely assumed to be a maker of HTML tags within JavaScript. The first argument is the tag name, followed by the second as the attributes, and the third as the element going in-between opening and closing tags.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
