开发者

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

开发者 https://www.devze.com 2023-04-06 18:55 出处:网络
Let\'s say I have the HTML <div class=\"ms-rtelong\"></div> <input type=\"text\" name=\"fname\"></input>

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

精彩评论

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