DOM manipulation in onAfterRenderQuestion
See original GitHub issueAre you requesting a feature, reporting a bug or ask a question?
Asking a question
What is the current behavior?
Using insertBefore
on htmlElement passed to onAfterRenderQuestion
has no effect.
What is the expected behavior?
DOM manipulation persists.
How would you reproduce the current behavior (if this is a bug)?
survey.onAfterRenderQuestion.add(function(survey, options){
var div = document.createElement("div");
div.innerHTML = "Q"+options.question.no;
div.className = 'sv_q_no';
options.htmlElement.insertBefore(div, options.htmlElement.querySelector('h5'));
options.htmlElement.appendChild(div);
});
The <div class="sv_q_no">Q1</div>
element is appended after the question but not inserted before.
Specify your
- browser:
Chrome
- browser version:
62.0.3202.94
- surveyjs platform (angular or react or jquery or knockout or vue):
jquery
- surveyjs version:
0.12.35
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
DOM manipulation in onAfterRenderQuestion #779 - GitHub
Using insertBefore on htmlElement passed to onAfterRenderQuestion has no effect. What is the expected behavior? DOM manipulation persists. How ...
Read more >Using onAfterRenderQuestion to update DOM - surveyjs Support
I'm trying to use onAfterRenderQuestion to add elements to the DOM. While it works, the event evidently fires whenever the question is ...
Read more >Manipulating documents - Learn web development | MDN
We have reached the end of our study of document and DOM manipulation. At this point you should understand what the important parts...
Read more >how to label in between surveyjs radio group - Stack Overflow
I have added the code with considering basic DOM element position. survey .onAfterRenderQuestion .add(function(){ $( //first I have collected ...
Read more >How to do DOM Manipulation properly in Angular?
There are many ways to manipulate the DOM in Angular. Let's use them instead of straight forward JavaScript approaches. Usually, there are two...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alasdaircr It should be fine from the next minor, v0.98.4
Thank you, Andrew
ok. If you need help, feel free to ask us.