We have such an object with properties in the form of headings and links:
var links = {"Title1": "link1", "Title2": "link2", "Title3": "link3" }; The page contains a bulleted list of the following type:
<ul class="list"> <li><b>12:00</b> <h3>Title1</h3> <i>Some text</i></li> <li><b>13:00</b> <h3>Title2</h3> <i>Some text</i></li> <li><b>14:00</b> <h3>Title3</h3></li> </ul> Is it possible to find a match on the headings and add a link to this particular item in the list? I would be grateful for the example, at least the definition of the desired item.
Final result:
<ul class="list"> <li><b>12:00</b> <h3>Title1</h3> <i>Some text</i> <a href="link1" title="Title1">Read more</a></li> <li><b>13:00</b> <h3>Title2</h3> <i>Some text</i> <a href="link2" title="Title2">Read more</a></li> <li><b>14:00</b> <h3>Title3</h3> <a href="link3" title="Title3">Read more</a></li> </ul> Or, in extreme cases, wrap the headline in a link.