I
I
iNeedHelp2016-08-01 00:56:13
Python
iNeedHelp, 2016-08-01 00:56:13

Is it possible to somehow manipulate pseudo-elements in JS?

Hello. I create html elements in a classic way:

let elem = document.createElement('p');
elem.innerHTML = 'text';
elem.className = 'class';

And I want to add a pseudo element to this element so :beforethat its content is equal to some text variable. How can this be implemented?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stanislav Silin, 2016-03-20
@byme

Qt has an abstraction over threads QtConcurrent . It has a run method . Where can you throw a method that you want to execute asynchronously. run will return you a QtFuture . Through it, we can find out what is happening with our thread (it has ended or is still running). A QtFuture can be passed to a QtFutureWatcher that has a finished signal that will fire when the function has completed its work.
The advantage of this approach is that Qt takes care of the hassle of creating and managing threads.

A
Alexander Ananiev, 2016-03-20
@SaNNy32

Use Windows messages via the SendMessage/PostMessage Api functions to communicate between threads.

A
Alexander Aksentiev, 2016-08-01
@Sanasol

stackoverflow.com/a/5734583
Only meaning?
It's all the same in JS, just add the necessary data to the beginning of the line...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question