AMP自动完成:在SELECT事件上运行一些自定义JS

问题描述 投票:0回答:1

是否可以在AMP中的select事件上运行一些自定义JS?

选择已添加自动完成功能。我们要将所选项目的ID保存到单独的隐藏字段中。

javascript amp-html
1个回答
0
投票

是。您可以使用amp-script来做到这一点:https://amp.dev/documentation/components/amp-script/

您还可以使用AMP.setState更改状态并绑定到自动完成功放事件。

[签出amp-bindhttps://amp.dev/documentation/components/amp-bind/。和Actions and Eventshttps://amp.dev/documentation/guides-and-tutorials/learn/amp-actions-and-events/

© www.soinside.com 2019 - 2024. All rights reserved.