In jquery, $("input") [I] .css () writes why it doesn't work.

var input=$ ("input")
for (iTuno political I < input.length;iPP) {
input [I] .css ("background", "red");
}

Why can"t you write like this? I haven"t found it for a long time

Feb.28,2021

input [I] .css ("background", "red");
input [I] this is converted to the native operation, using input.eq (i)


var input=$("input")
input.each(function(){
    ...
    $(this).css()
})

var input=$("input")
for (i=0;i<input.length;iPP){ 
    $(input[i]).css("background","red");
}

css () is a prototype method for jQuery objects and cannot be used on DOM node objects.


if only css were set the same directly

$("input").css("background","red");

Please do not [I] this turns the jq object into a dom object, please use eq (i)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5b386-4561f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5b386-4561f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?