是否可以在AMP中的select事件上运行一些自定义JS?
选择已添加自动完成功能。我们要将所选项目的ID保存到单独的隐藏字段中。
是。您可以使用amp-script
来做到这一点:https://amp.dev/documentation/components/amp-script/
您还可以使用AMP.setState
更改状态并绑定到自动完成功放事件。
[签出amp-bind
:https://amp.dev/documentation/components/amp-bind/。和Actions and Events
:https://amp.dev/documentation/guides-and-tutorials/learn/amp-actions-and-events/