jQuery / Программно Избранный Опция в Избранном Поле

Легче бит - использует WMI.

$service = gwmi win32_service -computer [computername] -filter "name='whatever'"
$service.change($null,$null,$null,$null,$null,$null,$null,"P@ssw0rd")

Меняют сервисное имя соответственно в фильтре; определите имя удаленного компьютера соответственно.

51
задан Dan Abramov 31 August 2018 в 04:47
поделиться

3 ответа

update:

As of jQuery 1.9, jQuery has updated changed this functionality. The "selected" state of an option is actually a property, therefore jQuery has changed this to use the .prop() method. Syntax is very similar and easy to switch:

$('#startTime option[value=17:00:00]').prop('selected', true);

See http://api.jquery.com/prop/#entry-longdesc for why it needs to pass true.


Older jQuery

$('#startTime option[value=17:00:00]').attr('selected', 'selected');

or

$('#startTime option[value='+ data[0].start +']').attr('selected', 'selected');
82
ответ дан 7 November 2019 в 09:49
поделиться
$('#startTime').val(start_time);
36
ответ дан 7 November 2019 в 09:49
поделиться

It's just $("#startTime").val(start_time);

10
ответ дан 7 November 2019 в 09:49
поделиться
Другие вопросы по тегам:

Похожие вопросы: