开发者

Change style of all elements with particular class apart from the first one?

Let's say I have the HTML

<div class="ms-rtelong"></div>
<input type="text" name="fname"></input>
<input type="text" name="lname"></input>
<div class="ms-rtelong"></div>
<div cl开发者_StackOverflow社区ass="ms-rtelong"></div>
<div class="ms-rtelong"></div>

With

$('.ms-rtelong').css({'width':'650px', 'height':'300px'});

If I want to change the size of all div's but want to leave the first one as it is, how can I do this?

Thanks in advance.


The :gt() selector should do it:

$('.ms-rtelong:gt(0)').css({'width':'650px', 'height':'300px'});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜