How to Capture Text of Items When Clicked: Revision history

Jump to: navigation, search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

10 June 2024

  • curprev 18:4818:48, 10 June 2024Admin talk contribs 648 bytes −4 No edit summary
  • curprev 18:4018:40, 10 June 2024Admin talk contribs 652 bytes +652 Created page with "=Example= <source> defmodule AppWeb.PageLive do use AppWeb, :live_view def render(assigns) do ~L""" <div id="list-container"> <ul> <%= for item <- @items do %> <li phx-click="capture_text" phx-value-text="<%= item %>"><%= item %></li> <% end %> </ul> </div> """ end def mount(_params, _session, socket) do items = ["Item 1", "Item 2", "Item 3"] # Example list items {:ok, assign(socket, items: items)}..."