作者: 199hehehaha 時間: 2023-6-11 22:26 標題: tampermonkey 可唔可以改變裝站上粒 button?
即係好似呢張圖咁, 原本係需要拉過去, 可唔可直接改做click button?

作者: alan11abc 時間: 2023-6-12 03:54
太耐沒上其他網,乜有呢種蠢設計……
直接改CSS, 之類?套返clicked values 。。
9u, ,沒做過 。但應該得
via HKEPC IR 5.1.14 - Android(5.1.1F)
作者: 199hehehaha 時間: 2023-6-12 21:59
請教應該可以點樣改?
<button type="submit" class="">Slide<span class="arrow-right"> →</span></button>
作者: justiceice 時間: 2023-6-13 08:59
document.querySelector('button[type="submit"] .arrow-right').parentNode.click();
會唔會得?
作者: 199hehehaha 時間: 2023-6-14 16:51
document.querySelector('button[type="submit"] .arrow-right').parentNode.click();
會唔會得? ...
justiceice 發表於 2023-6-13 08:59
THX, 不過唔得
作者: louislam 時間: 2023-6-15 11:45
我估佢用js trigger event, 可以試下用F12 裡面有個 Event Listener Breakpoints, 剔晒佢
之後submit, 睇下會唔會喺邊句CODE停底
[attach]2377395[/attach]
作者: javacomhk 時間: 2023-6-17 21:45
- // ==UserScript==
- // @name Change Button Code
- // @version 0.1
- // @description This script will change the code of a button and add a click action.
- // @author Bard
- // @match https://www.example.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- // Find the button element
- var button = document.querySelector("button[type='submit']")
- // Change the code of the button
- button.innerHTML = "Click"
- // Add a click action to the button
- button.addEventListener("click", function() {
- alert("You clicked the button!");
- })
- })()

