+ 3

Manipulating some items in the selected class in jquery

hi! how can i set values of some elements for e.g i have 9 div and i want to access some of those div using jquery how can i do that when i do like this it gives error $('div)[x].css("backgroundColor", "#fff");

25th Sep 2017, 8:04 AM
adeel salim
adeel salim - avatar
3 Respostas
25th Sep 2017, 8:11 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
$("div:eq(2)").css("backgroundColor","#fff"); //selects 3rd div element
2nd Oct 2017, 4:10 AM
gban
0
thanks! but can you suggest what should be the correct syntax if i want to access x nbr div
25th Sep 2017, 8:33 AM
adeel salim
adeel salim - avatar