2010-06-11 79 views
1

HI, 我想要查找顯示沒有設置爲none的HTML字符串中的所有輸入元素。 我用JQuery嘗試過,它似乎不喜歡在style屬性中尋找。 任何想法? 我有以下HTML:使用jquery查找樣式屬性

<SPAN style="DISPLAY: none">4B holdings AG</SPAN><SPAN dropdownCell="onShowInvestorDropDown(ele, currentText)"></SPAN><INPUT style="DISPLAY: none" value="4B holdings AG" name=potbookgrid$ctl00$ctl08$ctl02> 
<DIV id=investorComboBoxPC> 
<DIV class="RadComboBox RadComboBox_Default" id=ctl02 style="DISPLAY: inline; WIDTH: 416px; ZOOM: 1" value="4B holdings AG"> 
<TABLE style="BORDER-TOP-WIDTH: 0px; TABLE-LAYOUT: fixed; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 100%; BORDER-COLLAPSE: collapse; BORDER-RIGHT-WIDTH: 0px" cellSpacing=0 cellPadding=0 summary=combobox border=0> 
<TBODY> 
<TR> 
<TD class="rcbInputCell rcbInputCellLeft" style="MARGIN-TOP: -1px; MARGIN-BOTTOM: -1px; WIDTH: 100%"><INPUT class=rcbInput id=ctl02_Input style="DISPLAY: block" value="4B holdings AG" name=ctl02 autocomplete="off" jQuery1276253231647="1"></TD> 
<TD class="rcbArrowCell rcbArrowCellRight rcbArrowCellHidden" style="MARGIN-TOP: -1px; MARGIN-BOTTOM: -1px"><A id=ctl02_Arrow style="DISPLAY: block; OVERFLOW: hidden; POSITION: relative; outline: none">select</A></TD></TR></TBODY></TABLE> 
<DIV class=rcbSlide style="Z-INDEX: 6000"><IFRAME style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; FILTER: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0); LEFT: 0px; BORDER-LEFT: 0px; WIDTH: 0px; BORDER-BOTTOM: 0px; POSITION: absolute; TOP: 0px; HEIGHT: 0px" tabIndex=-1 src="javascript:'';" frameBorder=0>Your browser does not support inline frames or is currently configured not to display inline frames.</IFRAME> 
<DIV class="RadComboBoxDropDown RadComboBoxDropDown_Default " id=ctl02_DropDown style="DISPLAY: none; FLOAT: left; WIDTH: 416px"> 
<DIV class=rcbHeader id=ctl02_Header> 
<TABLE style="TABLE-LAYOUT: fixed"> 
<TBODY> 
<TR> 
<TD width=60>Investor Code</TD> 
<TD width=150>Investor Name</TD> 
<TD width=90>City</TD> 
<TD width=100>Country</TD></TR></TBODY></TABLE></DIV> 
<DIV class="rcbScroll rcbWidth" style="WIDTH: 100%" jQuery1276253231647="2"></DIV></DIV></DIV><INPUT id=ctl02_ClientState type=hidden value='{"logEntries":[],"value":"","text":"4B holdings AG","enabled":true}' name=ctl02_ClientState autocomplete="off"> </DIV></DIV> 
+0

你能證明你所嘗試過的嗎? – 2010-06-11 11:30:02

+0

您是否確實在DOM中包含這些元素,或者只是包含這些內容的字符串? – 2010-06-11 11:34:40

+0

我在DOM中使用它,它實際上是來自單元格的內容。 我需要的是顯示設置爲內聯或塊的所有輸入項目。 所以我希望找到的結果是「ctl02_Input」。 – Rubans 2010-06-11 12:51:07

回答

0
$("input:visible").css("border","1px solid red"); 

+0

非常好,這是我需要的。 – Rubans 2010-06-11 12:53:12