mysql add attr_基于jQuery的为attr添加id title等效果的实现代码

核心代码:

$(document).ready(function(){

//$('div.chapter a').attr({'rel':'external'});

$('div.chapter a').each(function(index){

var $linkthis=$(this)

$linkthis.attr({

'rel':'external',

'id':'wikilink-'+index,

'title':'你好,现在在试验'+$linkthis.text()

});

});

$('#wikilink-1').css('fontSize',33);

});

完整测试代码:

/p>

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

DOM Manipulation

$(document).ready(function(){

//$('div.chapter a').attr({'rel':'external'});

$('div.chapter a').each(function(index){

var $linkthis=$(this)

$linkthis.attr({

'rel':'external',

'id':'wikilink-'+index,

'title':'你好,现在在试验'+$linkthis.text()

});

});

$('#wikilink-1').css('fontSize',33);

});

Flatland: A Romance of Many Dimensions

by Edwin A. Abbott

Part 1, Section 3

Concerning the Inhabitants of Flatland

an excerpt

Our Professional Men and Gentlemen are Squares (to which class I myself belong) and Five-Sided Figures or Pentagons.

Next above these come the Nobility, of whom there are several degrees, beginning at Six-Sided Figures, or Hexagons, and from thence rising in the number of their sides till they receive the honourable title of Polygonal, or many-Sided. Finally when the number of the sides becomes so numerous, and the sides themselves so small, that the figure cannot be distinguished from a circle, he is included in the Circular or Priestly order; and this is the highest class of all.

It is a Law of Nature with us that a male child shall have one more side than his father, so that each generation shall rise (as a rule) one step in the scale of development and nobility. Thus the son of a Square is a Pentagon; the son of a Pentagon, a Hexagon; and so on.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值