문제

Here is the HTML of the button i would like to click:

<div style="" class="widgetPlaceholder widgetExpireTurbo" data-widget="turboBinary_tradologic_expireTurbo">

<input type="button" value="15s" class="expireTurboRuleInterval activeRule" data-ruleid="149">
<input type="button" value="30s" class="expireTurboRuleInterval" data-ruleid="148">
<input type="button" value="45s" class="expireTurboRuleInterval" data-ruleid="147">
<input type="button" value="1m" class="expireTurboRuleInterval" data-ruleid="106">
<input type="button" value="2m" class="expireTurboRuleInterval" data-ruleid="107">
<input type="button" value="5m" class="expireTurboRuleInterval" data-ruleid="108">

</div>

I wish to click the button with the value="30s" progmatically via jquery.

Here is the URL: https://binarykings.co.uk/traderoom-aspx?game=turbo&view=single&lang=en&filter=currencies

Thanks

도움이 되었습니까?

해결책 2

Use attribute-equals-selector

jQuery('input[value="30s"]').click();

다른 팁

You can use Attribute Equals Selector [name="value"]

Live Demo

$(':button[value="30s"]').click();
$('input[value="30s"]').click();

You need to use selector on attibute and also call click when page is loaded:

$(function(){$('input[value="30s"]').click();})

FIDDLE

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top