ใช้ในการเลือก element ได้แก่ input , textarea , select และ button
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":input").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก input element ที่มี type เท่ากับ text
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":text").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก input element ที่มี type เท่ากับ password
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":password").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก input element ที่มี type เท่ากับ radio
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":radio").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก input element ที่มี type เท่ากับ checkbox
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":checkbox").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก input element ที่มี type เท่ากับ submit
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":submit").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก input element ที่มี type เท่ากับ image
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":image").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก input element ที่มี type เท่ากับ reset
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":reset").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก button และ input element ที่มี type เท่ากับ button
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":button").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก input element ที่มี type เท่ากับ file
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":file").css("backgroundColor","red"); }); </ script > |
ใช้ในการเลือก element ที่เป็น hidden หรือ input element ที่มี type เท่ากับ hidden
1 2 3 4 5 | < script language = "javascript" > $(function(){ $(":hidden").css("backgroundColor","red"); }); </ script > |