Is it possible to select text in an HTML document without using it without <span>or any other tag?
<span>
For example, in HTML, <p>The quick fox</p>I would like to highlight quick, but without adding a DOM element around it. Adding a DOM element to the parent element is fine.
<p>The quick fox</p>
quick
Thanks!
No, It is Immpossible.
You cannot tell the browser to render a piece of text differently without changing the DOM, regardless of whether you execute it statically or dynamically (for example, using Javascript as a post-processing step).
, ( rgba hsla) .
canvas , .
.
, , , , Javascript magic. -
<p highlight="quick">The quick fox</p>
JQuery/Prototype/plain JS, , ? , - .
The only way to do this than I can imagine is to use an element <canvas>and display absolutely everything manually.
<canvas>