2013-04-13 40 views
0

我試圖從html下拉取值使用webview,這是用分段控制器填充。stringbyevaluatingjavascriptstring從下拉列表

任何人都知道如何爲下面的HTML代碼輸入

NSString *string [NSString stringWithFormat:@"document.getElementsBy 

,並選擇選項之一值

<div id="loginselect" style="clear:both:"> 
      <select name="usertype" size="1" id="usertype" class="select1" >  
<option value="0" selected="selected">Staff</option> 
<option value="1" >Student</option> 
<option value="2" >Parent</option> 

回答

0
document.getElementByID('usertype').value 
+0

但是我怎樣才能指定值並使其被選中? – Pierre

0

從sixthcent答案給了正確的答案。我只需要添加這樣的值:

document.getElementById('usertype').value='1'