我需要括號中的數字,在本例中爲「14」,以便我可以將它發送到頁面上的JavaScript函數以提交,或者可以選擇「單擊」按鈕「當前周」?從WebBrowser中的HTML元素獲取屬性值
<form id="timetablesForm" action="timetablesController.jsp" method="post">
<p>
<input type="button" name="Current week" value="Current week" onclick="javascript:void+displayTimetable('14')" />
<input type="button" name="Next week" value="Next week" onclick="javascript:void+displayTimetable('15')" />
<input type="button" name="Current semester" value="Semester 1" onclick="javascript:void displayTimetable('7;8;9;10;11;12;13;14;15;16;17;21')" />
</p>
function displayTimetable(selectdweeks)
我正在使用Windows Phone,因此WebBrowser.Document
不可用。我用下面的腳本來設置不同形式的值:
webBrowser1.InvokeScript("eval", "document.getElementById('loginform1').user.value = 'username';");
如何得到從HTML頁面的值?還有什麼其他功能可以撥打InvokeScript
?如果你能指出我的功能列表,請欣賞它。
嘗試了許多變體的對象val = webBrowser1.InvokeScript(「eval」,「document.getElementById('timetablesForm')。'Current week'.onclick.value;」 );'但所有拋出一個SystemException – StanOverflow