0

it is possible to reduce the ID?

$ie.Document.getElementById("ctl00_m_g_27855e01_08c1_498d_b130_0b761c472fbd_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField").value = "Test Text"

like (Not working!)

$ie.Document.getElementById("*ctl00_ctl04_ctl00_ctl00_TextField").value = "Test Text"
4

1 回答 1

1

你可以使用 jQuery:

$('[id$=ctl00_ctl04_ctl00_ctl00_TextField]').val("Test Text");

当然,性能会受到影响,但除非在大页面上经常发生这种情况,否则不会引起注意。

于 2010-12-27T18:06:32.327 回答