当前位置: 代码迷 >> HTML/CSS >> 如何用选择器拿到这个值
  详细解决方案

如何用选择器拿到这个值

热度:94   发布时间:2012-05-22 18:18:54.0
怎么用选择器拿到这个值?
<dl id="researchdl">
  <dt>检索条件:题名=<font color="red">经济</font> </font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;结果数:<b><font color="red">1036</font></b> 
  &nbsp;&nbsp;<a target="_blank" href="search_rss.php?location=ALL&title=%E7%BB%8F%E6%B5%8E&doctype=ALL&lang_code=ALL&match_flag=forward&displaypg=20&showmode=list&orderby=DESC&use_flag=3&sort=CATA_DATE&onlylendable=yes"><img src="../tpl/red/images/rss.gif" alt="此检索条件下的结果RSS源" border="0" /></a>
  &nbsp;&nbsp;<b><a href="?location=ALL&title=%E7%BB%8F%E6%B5%8E&doctype=ALL&lang_code=ALL&match_flag=forward&displaypg=20&showmode=list&orderby=DESC&use_flag=3&sort=CATA_DATE&onlylendable=yes" >

就是想拿到1036那个值~~不太会用~~谢谢啊

------解决方案--------------------
JScript code
$(document).ready( function() {
    $("#researchdl b font").each( function() {
        alert($(this).text());
    });
});

------解决方案--------------------
HTML code

<script src="http://code.jquery.com/jquery-latest.js"></script>
<dl id="researchdl">
  <dt>检索条件:题名=<font color="red">经济</font> </font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;结果数:<b><font color="red">1036</font></b>  
  &nbsp;&nbsp;<a target="_blank" href="search_rss.php?location=ALL&title=%E7%BB%8F%E6%B5%8E&doctype=ALL&lang_code=ALL&match_flag=forward&displaypg=20&showmode=list&orderby=DESC&use_flag=3&sort=CATA_DATE&onlylendable=yes"><img src="../tpl/red/images/rss.gif" alt="此检索条件下的结果RSS源" border="0" /></a>
  &nbsp;&nbsp;<b><a href="?location=ALL&title=%E7%BB%8F%E6%B5%8E&doctype=ALL&lang_code=ALL&match_flag=forward&displaypg=20&showmode=list&orderby=DESC&use_flag=3&sort=CATA_DATE&onlylendable=yes" >
<script>

    alert( $('#researchdl b font').html() )
</script> 
  相关解决方案