jQuery Realization Method of Finding Linked Text Replacement Attribute

  • 2021-07-01 06:09:52
  • OfStack

This article describes the example of jQuery to find the link text replacement attribute method, and share it with you for your reference, as follows:


<!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=utf-8" />
<title>jQuery Link text replacement property </title>
<script language="JavaScript" src="jquery-1.7.2.min.js"></script>
<script language="JavaScript" type="text/JavaScript"> 
 $(document).ready(function(e) {
  var aa = $('a font[title$=" Home page "]').html();
  if(aa==' Home page '){
   $('.page').find('a').eq(0).attr("href", "/page/?type=index");
  }
});
 </script>
  </head>
  <body>
   <div class="page">
     <a href="#"><font title=" Home page "> Home page </font></a>
     <a href="#"> Upper 1 Page </a>
     <a href="#"> Current page </a>
     <a href="#"> Under 1 Page </a>
     <a href="#"> End page </a>
   </div>
  </body>
</html>

For more readers interested in jQuery related content, please check the topics of this site: "Summary of jQuery Operating DOM Node", "Summary of jQuery Extension Skills", "Summary of jQuery Common Plug-ins and Usage", "Summary of jQuery Drag Effects and Skills", "Summary of jQuery Table (table) Operation Skills", "Summary of Ajax Usage in jquery", "Summary of jQuery Common Classic Special Effects", "Summary of jQuery Animation and Special Effects Usage" and "Summary of jquery Selector Usage"

I hope this article is helpful to everyone's jQuery programming.


Related articles: