Is there a way to jslink a <a href> to a Toggle widget (to indicate seen?)

import panel as pn
toggle =pn.widgets.Toggle(value=False)
href = pn.pane.HTML("<a href="">Visit!</a>")

if href clicked, toggle.value = True

Using ReactiveHTML it should be possible:

class Link(pn.reactive.ReactiveHTML):
    click = param.Integer(default=0)
    _template = """<a id="a" target="_blank" onclick="${script('update_click')}" href="">Visit!</a>"""
    _scripts = {
        "update_click": """
toggle =pn.widgets.Toggle(value=False)
link = Link()
link.jscallback(args={"toggle": toggle}, click=" = (>0)")
pn.Column(toggle, link)
1 Like