Within this paragraph lies a collection of text encapsulated by a < p > tag. When this content is displayed on the page, it spans across 5 lines. My objective is to creatively style and position a < div > tag in order to highlight a specific line without requiring any alterations to the original < p > tag or its inner content. Ideally, I aim to achieve this using jQuery.
The HTML markup appears as follows:
<p>one fish two fish red fish zoo fish fifth fish</p>
Upon rendering, the output presents itself in this format:
one fish
two fish
red fish
zoo fish
fifth fish
My intention is to overlap a transparent red div on the third line which contains "red fish".
I have not attempted any solutions yet and currently lack innovative ideas.
In response to Matt Burland's inquiry: I am tasked with devising a function that can identify an element P along with a specified line number, subsequently placing a colored box over that corresponding line upon being rendered.
The content within the paragraph could feasibly span various numbers of lines when displayed.
Fortunately, the window size remains constant, alleviating one aspect of concern.
As for additional functionality, it must be contingent upon the existing DOM structure of the webpage. While I possess the capability to add a div tag, my options for manipulation are relatively limited.