DIV

2009-07-29 7 views
0

에서 jQuery로 더 href가 나는 아래로 사업부가 없을 때 리를 제거 : 더 HREF는 jQuery에 을 통해 사업부 위에서오고있을 경우 지금은 을 제거 할DIV

<div id="DivInteractive"> 
     <p><strong>INTERACTIVE ONLINE BROCHURE</strong></p> 
     <ul> 
         <li><a href="" target="_blank"/></li> 
         <li><a href="http://www.espireinfo.com" target="_blank">Internship brochure Interactive 2008</a></li> 
         <li><a href="http://www.google.com" target="_blank">OPUS EU Flyer Interactive 2009</a></li> 
         <li><a href="http://www.rai.com" target="_blank">2009 PLI Interactive Brochure</a></li> 
         <li><a href="http://cmsstag/index.aspx" target="_blank">Worldwide brochure Interactive English 2009</a></li> 
       </ul> 
</div> 

페이지가로드 될 경우 위, 그것은 최초의 리튬을 제거하고 내 출력에 대해서 설명한다 같이

<div id="DivInteractive"> 
      <p><strong>INTERACTIVE ONLINE BROCHURE</strong></p> 
      <ul> 

          <li><a href="http://www.espireinfo.com" target="_blank">Internship brochure Interactive 2008</a></li> 
          <li><a href="http://www.google.com" target="_blank">OPUS EU Flyer Interactive 2009</a></li> 
          <li><a href="http://www.rai.com" target="_blank">2009 PLI Interactive Brochure</a></li> 
          <li><a href="http://cmsstag/index.aspx" target="_blank">Worldwide brochure Interactive English 2009</a></li> 
        </ul> 
    </div> 

jQuery를

를 사용하는 솔루션을 제안하십시오

답변

2

이 방법이 효과가 있습니까?

$("#DivInteractive li:has(a[href=''])").remove(); 
+0

div id = "DivInteractive"만 제거하려는 경우 –

+0

내 페이지에서와 같이 작동하지 않는 페이지로 이동합니다. 나는 완전한 페이지를 체크인 할 필요가 있다고 생각한다. –

+0

그것은 작동하지 않는 .remove() 함수 일 수 있습니다. –

0

내가 정규식 너무 잘 모르겠지만, 클리 터스 '대답에 추가, 나는 할 것이다 :

$("#DivInteractive li:has(a[href='regex(check for on or more spaces)'])").remove(); 

이 방법은, 그것을 제거 할 href를 "가"로 설정 한 경우 또는 ""또는 무엇이든간에.