javascript搜尋尋找當前頁面字串

來源:互聯網
上載者:User

<!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>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>網頁特效搜尋尋找當前頁面字串</title>
<script language="javascript">
function checkarea(){
 var $ = function(id){return document.getelementbyid(id)};

 var v =$('models').value;

 if(v =='請輸入機型'){
  return false;
 }
 if(!$('type_'+v)){
  alert('沒有這種型號!')
  return false;
 }
 $('type_'+v).style.border = '1px dashed #0000ff';
 $('type_'+v).style.background = '#00ccff';
 $('type_'+v).style.color = '#6666ff';
 location.href = "#type_"+v;
}
</script>


</head>

<body>
<div style="float: left;padding-left:30px; width:40">
    <ul>
     <li><input name="models" id="models" value='請輸入機型' size='30' onclick="this.value=''">
     <input type='button' value="提交機型" onclick="checkarea()"></li>
    
    </ul>
    

    
    
    </div>
          <li><a href="/nokia/3155.html" id='type_3155' title="諾基亞3155手機遊戲">3155</a></li>

   
   <li><a href="/nokia/3152.html" id='type_3152' title="諾基亞3152手機遊戲">3152</a></li>

<li><a href="http://www.111cn.net" id='type_nuron' title="諾基亞nuron手機遊戲">nuron</a></li>
</body>
</html>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.