Saludos,
- Me parece que es igual, en el libro jQuery Pocket Reference dice:
var paras = $("p");
paras.first() // Select only the first <p> tag
paras.last() // Select only the last <p>
paras.eq(1) // Select the second <p>
paras.eq(-2) // Select the second to last <p>
paras[1] // The second <p> tag, itself
- Y para establecer estilos se sigue esta sintáxis:
$("h1").css("font-weight"); // Get font weight of 1st <h1>
$("h1").css("fontWeight"); // Camel case works, too
$("h1").css("font"); // ERROR: can't query compound style
$("h1").css("font-variant", // Set style on all <h1> tags
"smallcaps");
$("div.note").css("border", // Okay to set compound styles
"solid black 2px");
// Set multiple styles at once
$("h1").css({ backgroundColor: "black",
textColor: "white",
fontVariant: "small-caps",
padding: "10px 2px 4px 20px",
border: "dotted black 4px" });
// Increase all <h1> font sizes by 25%
$("h1").css("font-size", function(i,curval) {
return Math.round(1.25*parseInt(curval));
});