2
For example, I want to take the DOM element, and then change, without it changing the behavior in the view:
//aqui pego o conteúdo da html
var content = $('.content').get(0);
//aqui eu reescrevo, porém ocorre que o $('.content') também está sendo alterado...???
var new_content = $(content).removeClass('ql-align-justify');
I want only the variable to be modified.
You want to create a clone, that’s it?
var content = $('.content').clone().get()
– Sergio
If I clone, the element will not be duplicated in the view?
– Ivan Ferrer
This is not possible to accomplish. You need to clone the object as @Sergio commented or create a "hidden" element and change it.
– Douglas Garrido
@Ivanferrer no, stay in the variable until you add it to DOM/View. That’s what you want?
– Sergio
It worked here Sergio, thank you.
– Ivan Ferrer
@Ivanferrer great! I left an answer for if others also look for the same problem.
– Sergio