本帖最后由 ce666de1 于 2013-04-09 15:59:28 编辑

解决方案 »

  1.   

    遍历所有元素,取到值符合ce666de1,再一层一层向上推,推到parentNode.tagName=='TABLE'的。
      

  2.   

    ce666de1和post-394156959有什么关系?最好你发点代码再说清楚点。
      

  3.   

    $('标签[value=ce666de1]').attr('id')
      

  4.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title> new document </title>
    </head><body>
    <div id="ddddddddd" class="">
    jhjjjjjjjjjjj
    </div>
    <div id="post-394156959">
    <span class=""><a href="">ce666de1</a></span>
    </div>
    <div id="ddhhhhd" class="">
    jhjjjjjjjjjjj
    </div>
    <script type="text/javascript">
    function gc(s)
    {
    var d = document.querySelectorAll("[id]");
    for(var i=0, l = d.length; i < l; ++i)
    if(d[i].innerHTML.indexOf(s)!=-1)
    return d[i];
    }alert(gc("ce666de1").id);
    </script>
    </body>
    </html>
      

  5.   

    jquery库遍历元素。但是效率很低,最好你知道ce666de1在什么html tag里面?比如div里面,那么$('*')改成$('div')
    jQuery(document).ready(function(){
    $('*').each(function(){
    if($(this).html()=='ce666de1'){
    alert($(this).attr('id'));
    }
    });
    });
    <div id="post-394156959">ce666de1</div>