0

一番上のdiv「srch-sb-results」のコンテキストで、クラス「srch-maintop」の深く埋もれたdivを選択する必要があります。jqueryを使用してsrch-maintop divを選択するにはどうすればよいですか?

私もここに近いですか?

$('.srch-sb-results').next('table').find('td#MainLeftCell div.srch-maintop').delete();  

それも触れませんでした..

<div class="srch-sb-results"> stuff here </div>
    <table>
       <tr>
          <td colspan='3'>
             <div style="border:1px solid silver"></div>
           </td>
         </tr>
         <tr>
             <td class="srch-leftcell">stuff</td>

            <td class="srch-mainleftcell">
               <div>stuff</div>
               <div class="srch-maintop"></div>
               <div class="srch-maintop2"></div>
            </td>

            <td class="srch-rightcell">stuff</td>
         </tr>

    <table>
4

4 に答える 4

0

問題はID#MainLeftCellとして書くことだと思いますが、それをclassとして書かなければなりません。はい...代わりに使用できます .MainLeftCell.remove().delete()

于 2013-01-24T17:04:44.017 に答える
0

ええ、あなたは近かったです;)

$('.srch-sb-results').next('table').find('td.srch-mainleftcell div.srch-maintop').delete();

于 2013-01-24T17:05:48.773 に答える
0

指定されたクラスに他の要素がない場合は、それを単独で使用できます。

$('.srch-maintop').remove();

または、クラス「srch-sb-results」の div の横にある表でより具体的なものを見つけるには:

$('.srch-sb-results').next('table').find('.srch-maintop').remove();
于 2013-01-24T17:11:36.093 に答える